{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<table style=\"float:left; border:none\">\n",
    "   <tr style=\"border:none; background-color: #ffffff\">\n",
    "       <td style=\"border:none\">\n",
    "           <a href=\"http://bokeh.org/\">     \n",
    "           <img \n",
    "               src=\"assets/bokeh-transparent.png\" \n",
    "               style=\"width:50px\"\n",
    "           >\n",
    "           </a>    \n",
    "       </td>\n",
    "       <td style=\"border:none\">\n",
    "           <h1>Bokeh Tutorial</h1>\n",
    "       </td>\n",
    "   </tr>\n",
    "</table>\n",
    "\n",
    "<div style=\"float:right;\"><h2>06. Linking and Interactions</h2></div>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "    <div class=\"bk-root\">\n",
       "        <a href=\"https://bokeh.org\" target=\"_blank\" class=\"bk-logo bk-logo-small bk-logo-notebook\"></a>\n",
       "        <span id=\"1001\">Loading BokehJS ...</span>\n",
       "    </div>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "\n",
       "(function(root) {\n",
       "  function now() {\n",
       "    return new Date();\n",
       "  }\n",
       "\n",
       "  var force = true;\n",
       "\n",
       "  if (typeof root._bokeh_onload_callbacks === \"undefined\" || force === true) {\n",
       "    root._bokeh_onload_callbacks = [];\n",
       "    root._bokeh_is_loading = undefined;\n",
       "  }\n",
       "\n",
       "  var JS_MIME_TYPE = 'application/javascript';\n",
       "  var HTML_MIME_TYPE = 'text/html';\n",
       "  var EXEC_MIME_TYPE = 'application/vnd.bokehjs_exec.v0+json';\n",
       "  var CLASS_NAME = 'output_bokeh rendered_html';\n",
       "\n",
       "  /**\n",
       "   * Render data to the DOM node\n",
       "   */\n",
       "  function render(props, node) {\n",
       "    var script = document.createElement(\"script\");\n",
       "    node.appendChild(script);\n",
       "  }\n",
       "\n",
       "  /**\n",
       "   * Handle when an output is cleared or removed\n",
       "   */\n",
       "  function handleClearOutput(event, handle) {\n",
       "    var cell = handle.cell;\n",
       "\n",
       "    var id = cell.output_area._bokeh_element_id;\n",
       "    var server_id = cell.output_area._bokeh_server_id;\n",
       "    // Clean up Bokeh references\n",
       "    if (id != null && id in Bokeh.index) {\n",
       "      Bokeh.index[id].model.document.clear();\n",
       "      delete Bokeh.index[id];\n",
       "    }\n",
       "\n",
       "    if (server_id !== undefined) {\n",
       "      // Clean up Bokeh references\n",
       "      var cmd = \"from bokeh.io.state import curstate; print(curstate().uuid_to_server['\" + server_id + \"'].get_sessions()[0].document.roots[0]._id)\";\n",
       "      cell.notebook.kernel.execute(cmd, {\n",
       "        iopub: {\n",
       "          output: function(msg) {\n",
       "            var id = msg.content.text.trim();\n",
       "            if (id in Bokeh.index) {\n",
       "              Bokeh.index[id].model.document.clear();\n",
       "              delete Bokeh.index[id];\n",
       "            }\n",
       "          }\n",
       "        }\n",
       "      });\n",
       "      // Destroy server and session\n",
       "      var cmd = \"import bokeh.io.notebook as ion; ion.destroy_server('\" + server_id + \"')\";\n",
       "      cell.notebook.kernel.execute(cmd);\n",
       "    }\n",
       "  }\n",
       "\n",
       "  /**\n",
       "   * Handle when a new output is added\n",
       "   */\n",
       "  function handleAddOutput(event, handle) {\n",
       "    var output_area = handle.output_area;\n",
       "    var output = handle.output;\n",
       "\n",
       "    // limit handleAddOutput to display_data with EXEC_MIME_TYPE content only\n",
       "    if ((output.output_type != \"display_data\") || (!output.data.hasOwnProperty(EXEC_MIME_TYPE))) {\n",
       "      return\n",
       "    }\n",
       "\n",
       "    var toinsert = output_area.element.find(\".\" + CLASS_NAME.split(' ')[0]);\n",
       "\n",
       "    if (output.metadata[EXEC_MIME_TYPE][\"id\"] !== undefined) {\n",
       "      toinsert[toinsert.length - 1].firstChild.textContent = output.data[JS_MIME_TYPE];\n",
       "      // store reference to embed id on output_area\n",
       "      output_area._bokeh_element_id = output.metadata[EXEC_MIME_TYPE][\"id\"];\n",
       "    }\n",
       "    if (output.metadata[EXEC_MIME_TYPE][\"server_id\"] !== undefined) {\n",
       "      var bk_div = document.createElement(\"div\");\n",
       "      bk_div.innerHTML = output.data[HTML_MIME_TYPE];\n",
       "      var script_attrs = bk_div.children[0].attributes;\n",
       "      for (var i = 0; i < script_attrs.length; i++) {\n",
       "        toinsert[toinsert.length - 1].firstChild.setAttribute(script_attrs[i].name, script_attrs[i].value);\n",
       "      }\n",
       "      // store reference to server id on output_area\n",
       "      output_area._bokeh_server_id = output.metadata[EXEC_MIME_TYPE][\"server_id\"];\n",
       "    }\n",
       "  }\n",
       "\n",
       "  function register_renderer(events, OutputArea) {\n",
       "\n",
       "    function append_mime(data, metadata, element) {\n",
       "      // create a DOM node to render to\n",
       "      var toinsert = this.create_output_subarea(\n",
       "        metadata,\n",
       "        CLASS_NAME,\n",
       "        EXEC_MIME_TYPE\n",
       "      );\n",
       "      this.keyboard_manager.register_events(toinsert);\n",
       "      // Render to node\n",
       "      var props = {data: data, metadata: metadata[EXEC_MIME_TYPE]};\n",
       "      render(props, toinsert[toinsert.length - 1]);\n",
       "      element.append(toinsert);\n",
       "      return toinsert\n",
       "    }\n",
       "\n",
       "    /* Handle when an output is cleared or removed */\n",
       "    events.on('clear_output.CodeCell', handleClearOutput);\n",
       "    events.on('delete.Cell', handleClearOutput);\n",
       "\n",
       "    /* Handle when a new output is added */\n",
       "    events.on('output_added.OutputArea', handleAddOutput);\n",
       "\n",
       "    /**\n",
       "     * Register the mime type and append_mime function with output_area\n",
       "     */\n",
       "    OutputArea.prototype.register_mime_type(EXEC_MIME_TYPE, append_mime, {\n",
       "      /* Is output safe? */\n",
       "      safe: true,\n",
       "      /* Index of renderer in `output_area.display_order` */\n",
       "      index: 0\n",
       "    });\n",
       "  }\n",
       "\n",
       "  // register the mime type if in Jupyter Notebook environment and previously unregistered\n",
       "  if (root.Jupyter !== undefined) {\n",
       "    var events = require('base/js/events');\n",
       "    var OutputArea = require('notebook/js/outputarea').OutputArea;\n",
       "\n",
       "    if (OutputArea.prototype.mime_types().indexOf(EXEC_MIME_TYPE) == -1) {\n",
       "      register_renderer(events, OutputArea);\n",
       "    }\n",
       "  }\n",
       "\n",
       "  \n",
       "  if (typeof (root._bokeh_timeout) === \"undefined\" || force === true) {\n",
       "    root._bokeh_timeout = Date.now() + 5000;\n",
       "    root._bokeh_failed_load = false;\n",
       "  }\n",
       "\n",
       "  var NB_LOAD_WARNING = {'data': {'text/html':\n",
       "     \"<div style='background-color: #fdd'>\\n\"+\n",
       "     \"<p>\\n\"+\n",
       "     \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n",
       "     \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n",
       "     \"</p>\\n\"+\n",
       "     \"<ul>\\n\"+\n",
       "     \"<li>re-rerun `output_notebook()` to attempt to load from CDN again, or</li>\\n\"+\n",
       "     \"<li>use INLINE resources instead, as so:</li>\\n\"+\n",
       "     \"</ul>\\n\"+\n",
       "     \"<code>\\n\"+\n",
       "     \"from bokeh.resources import INLINE\\n\"+\n",
       "     \"output_notebook(resources=INLINE)\\n\"+\n",
       "     \"</code>\\n\"+\n",
       "     \"</div>\"}};\n",
       "\n",
       "  function display_loaded() {\n",
       "    var el = document.getElementById(\"1001\");\n",
       "    if (el != null) {\n",
       "      el.textContent = \"BokehJS is loading...\";\n",
       "    }\n",
       "    if (root.Bokeh !== undefined) {\n",
       "      if (el != null) {\n",
       "        el.textContent = \"BokehJS \" + root.Bokeh.version + \" successfully loaded.\";\n",
       "      }\n",
       "    } else if (Date.now() < root._bokeh_timeout) {\n",
       "      setTimeout(display_loaded, 100)\n",
       "    }\n",
       "  }\n",
       "\n",
       "\n",
       "  function run_callbacks() {\n",
       "    try {\n",
       "      root._bokeh_onload_callbacks.forEach(function(callback) {\n",
       "        if (callback != null)\n",
       "          callback();\n",
       "      });\n",
       "    } finally {\n",
       "      delete root._bokeh_onload_callbacks\n",
       "    }\n",
       "    console.debug(\"Bokeh: all callbacks have finished\");\n",
       "  }\n",
       "\n",
       "  function load_libs(css_urls, js_urls, callback) {\n",
       "    if (css_urls == null) css_urls = [];\n",
       "    if (js_urls == null) js_urls = [];\n",
       "\n",
       "    root._bokeh_onload_callbacks.push(callback);\n",
       "    if (root._bokeh_is_loading > 0) {\n",
       "      console.debug(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n",
       "      return null;\n",
       "    }\n",
       "    if (js_urls == null || js_urls.length === 0) {\n",
       "      run_callbacks();\n",
       "      return null;\n",
       "    }\n",
       "    console.debug(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n",
       "    root._bokeh_is_loading = css_urls.length + js_urls.length;\n",
       "\n",
       "    function on_load() {\n",
       "      root._bokeh_is_loading--;\n",
       "      if (root._bokeh_is_loading === 0) {\n",
       "        console.debug(\"Bokeh: all BokehJS libraries/stylesheets loaded\");\n",
       "        run_callbacks()\n",
       "      }\n",
       "    }\n",
       "\n",
       "    function on_error() {\n",
       "      console.error(\"failed to load \" + url);\n",
       "    }\n",
       "\n",
       "    for (var i = 0; i < css_urls.length; i++) {\n",
       "      var url = css_urls[i];\n",
       "      const element = document.createElement(\"link\");\n",
       "      element.onload = on_load;\n",
       "      element.onerror = on_error;\n",
       "      element.rel = \"stylesheet\";\n",
       "      element.type = \"text/css\";\n",
       "      element.href = url;\n",
       "      console.debug(\"Bokeh: injecting link tag for BokehJS stylesheet: \", url);\n",
       "      document.body.appendChild(element);\n",
       "    }\n",
       "\n",
       "    for (var i = 0; i < js_urls.length; i++) {\n",
       "      var url = js_urls[i];\n",
       "      var element = document.createElement('script');\n",
       "      element.onload = on_load;\n",
       "      element.onerror = on_error;\n",
       "      element.async = false;\n",
       "      element.src = url;\n",
       "      console.debug(\"Bokeh: injecting script tag for BokehJS library: \", url);\n",
       "      document.head.appendChild(element);\n",
       "    }\n",
       "  };var element = document.getElementById(\"1001\");\n",
       "  if (element == null) {\n",
       "    console.error(\"Bokeh: ERROR: autoload.js configured with elementid '1001' but no matching script tag was found. \")\n",
       "    return false;\n",
       "  }\n",
       "\n",
       "  function inject_raw_css(css) {\n",
       "    const element = document.createElement(\"style\");\n",
       "    element.appendChild(document.createTextNode(css));\n",
       "    document.body.appendChild(element);\n",
       "  }\n",
       "\n",
       "  \n",
       "  var js_urls = [\"https://cdn.pydata.org/bokeh/release/bokeh-1.4.0.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-widgets-1.4.0.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-tables-1.4.0.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-gl-1.4.0.min.js\"];\n",
       "  var css_urls = [];\n",
       "  \n",
       "\n",
       "  var inline_js = [\n",
       "    function(Bokeh) {\n",
       "      Bokeh.set_log_level(\"info\");\n",
       "    },\n",
       "    function(Bokeh) {\n",
       "    \n",
       "    \n",
       "    }\n",
       "  ];\n",
       "\n",
       "  function run_inline_js() {\n",
       "    \n",
       "    if (root.Bokeh !== undefined || force === true) {\n",
       "      \n",
       "    for (var i = 0; i < inline_js.length; i++) {\n",
       "      inline_js[i].call(root, root.Bokeh);\n",
       "    }\n",
       "    if (force === true) {\n",
       "        display_loaded();\n",
       "      }} else if (Date.now() < root._bokeh_timeout) {\n",
       "      setTimeout(run_inline_js, 100);\n",
       "    } else if (!root._bokeh_failed_load) {\n",
       "      console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n",
       "      root._bokeh_failed_load = true;\n",
       "    } else if (force !== true) {\n",
       "      var cell = $(document.getElementById(\"1001\")).parents('.cell').data().cell;\n",
       "      cell.output_area.append_execute_result(NB_LOAD_WARNING)\n",
       "    }\n",
       "\n",
       "  }\n",
       "\n",
       "  if (root._bokeh_is_loading === 0) {\n",
       "    console.debug(\"Bokeh: BokehJS loaded, going straight to plotting\");\n",
       "    run_inline_js();\n",
       "  } else {\n",
       "    load_libs(css_urls, js_urls, function() {\n",
       "      console.debug(\"Bokeh: BokehJS plotting callback run at\", now());\n",
       "      run_inline_js();\n",
       "    });\n",
       "  }\n",
       "}(window));"
      ],
      "application/vnd.bokehjs_load.v0+json": "\n(function(root) {\n  function now() {\n    return new Date();\n  }\n\n  var force = true;\n\n  if (typeof root._bokeh_onload_callbacks === \"undefined\" || force === true) {\n    root._bokeh_onload_callbacks = [];\n    root._bokeh_is_loading = undefined;\n  }\n\n  \n\n  \n  if (typeof (root._bokeh_timeout) === \"undefined\" || force === true) {\n    root._bokeh_timeout = Date.now() + 5000;\n    root._bokeh_failed_load = false;\n  }\n\n  var NB_LOAD_WARNING = {'data': {'text/html':\n     \"<div style='background-color: #fdd'>\\n\"+\n     \"<p>\\n\"+\n     \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n     \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n     \"</p>\\n\"+\n     \"<ul>\\n\"+\n     \"<li>re-rerun `output_notebook()` to attempt to load from CDN again, or</li>\\n\"+\n     \"<li>use INLINE resources instead, as so:</li>\\n\"+\n     \"</ul>\\n\"+\n     \"<code>\\n\"+\n     \"from bokeh.resources import INLINE\\n\"+\n     \"output_notebook(resources=INLINE)\\n\"+\n     \"</code>\\n\"+\n     \"</div>\"}};\n\n  function display_loaded() {\n    var el = document.getElementById(\"1001\");\n    if (el != null) {\n      el.textContent = \"BokehJS is loading...\";\n    }\n    if (root.Bokeh !== undefined) {\n      if (el != null) {\n        el.textContent = \"BokehJS \" + root.Bokeh.version + \" successfully loaded.\";\n      }\n    } else if (Date.now() < root._bokeh_timeout) {\n      setTimeout(display_loaded, 100)\n    }\n  }\n\n\n  function run_callbacks() {\n    try {\n      root._bokeh_onload_callbacks.forEach(function(callback) {\n        if (callback != null)\n          callback();\n      });\n    } finally {\n      delete root._bokeh_onload_callbacks\n    }\n    console.debug(\"Bokeh: all callbacks have finished\");\n  }\n\n  function load_libs(css_urls, js_urls, callback) {\n    if (css_urls == null) css_urls = [];\n    if (js_urls == null) js_urls = [];\n\n    root._bokeh_onload_callbacks.push(callback);\n    if (root._bokeh_is_loading > 0) {\n      console.debug(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n      return null;\n    }\n    if (js_urls == null || js_urls.length === 0) {\n      run_callbacks();\n      return null;\n    }\n    console.debug(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n    root._bokeh_is_loading = css_urls.length + js_urls.length;\n\n    function on_load() {\n      root._bokeh_is_loading--;\n      if (root._bokeh_is_loading === 0) {\n        console.debug(\"Bokeh: all BokehJS libraries/stylesheets loaded\");\n        run_callbacks()\n      }\n    }\n\n    function on_error() {\n      console.error(\"failed to load \" + url);\n    }\n\n    for (var i = 0; i < css_urls.length; i++) {\n      var url = css_urls[i];\n      const element = document.createElement(\"link\");\n      element.onload = on_load;\n      element.onerror = on_error;\n      element.rel = \"stylesheet\";\n      element.type = \"text/css\";\n      element.href = url;\n      console.debug(\"Bokeh: injecting link tag for BokehJS stylesheet: \", url);\n      document.body.appendChild(element);\n    }\n\n    for (var i = 0; i < js_urls.length; i++) {\n      var url = js_urls[i];\n      var element = document.createElement('script');\n      element.onload = on_load;\n      element.onerror = on_error;\n      element.async = false;\n      element.src = url;\n      console.debug(\"Bokeh: injecting script tag for BokehJS library: \", url);\n      document.head.appendChild(element);\n    }\n  };var element = document.getElementById(\"1001\");\n  if (element == null) {\n    console.error(\"Bokeh: ERROR: autoload.js configured with elementid '1001' but no matching script tag was found. \")\n    return false;\n  }\n\n  function inject_raw_css(css) {\n    const element = document.createElement(\"style\");\n    element.appendChild(document.createTextNode(css));\n    document.body.appendChild(element);\n  }\n\n  \n  var js_urls = [\"https://cdn.pydata.org/bokeh/release/bokeh-1.4.0.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-widgets-1.4.0.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-tables-1.4.0.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-gl-1.4.0.min.js\"];\n  var css_urls = [];\n  \n\n  var inline_js = [\n    function(Bokeh) {\n      Bokeh.set_log_level(\"info\");\n    },\n    function(Bokeh) {\n    \n    \n    }\n  ];\n\n  function run_inline_js() {\n    \n    if (root.Bokeh !== undefined || force === true) {\n      \n    for (var i = 0; i < inline_js.length; i++) {\n      inline_js[i].call(root, root.Bokeh);\n    }\n    if (force === true) {\n        display_loaded();\n      }} else if (Date.now() < root._bokeh_timeout) {\n      setTimeout(run_inline_js, 100);\n    } else if (!root._bokeh_failed_load) {\n      console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n      root._bokeh_failed_load = true;\n    } else if (force !== true) {\n      var cell = $(document.getElementById(\"1001\")).parents('.cell').data().cell;\n      cell.output_area.append_execute_result(NB_LOAD_WARNING)\n    }\n\n  }\n\n  if (root._bokeh_is_loading === 0) {\n    console.debug(\"Bokeh: BokehJS loaded, going straight to plotting\");\n    run_inline_js();\n  } else {\n    load_libs(css_urls, js_urls, function() {\n      console.debug(\"Bokeh: BokehJS plotting callback run at\", now());\n      run_inline_js();\n    });\n  }\n}(window));"
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "from bokeh.io import output_notebook, show\n",
    "from bokeh.plotting import figure\n",
    "output_notebook()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now that we know from the previous chapter how multiple plots can be placed together in a layout, we can start to look at how different plots can be linked togeher, or how plots can be linked to widgets. "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Linked Interactions\n",
    "\n",
    "It is possible to link various interactions between different Bokeh plots. For instance, the ranges of two (or more) plots can be linked, so that when one of the plots is panned (or zoomed, or otherwise has its range changed) the other plots will update in unison. It is also possible to link selections between two plots, so that when items are selected on one plot, the corresponding items on the second plot also become selected. "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Linked panning\n",
    "\n",
    "Linked panning (when multiple plots have ranges that stay in sync) is simple to spell with Bokeh. You simply share the appropriate range objects between two (or more) plots. The example below shows how to accomplish this by linking the ranges of three plots in various ways:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "  <div class=\"bk-root\" id=\"2880d8c3-0486-4bf6-bc03-a2891652b4f3\" data-root-id=\"1116\"></div>\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "(function(root) {\n",
       "  function embed_document(root) {\n",
       "    \n",
       "  var docs_json = {\"8c1dccb5-ce36-4b77-9df2-63233dc50bba\":{\"roots\":{\"references\":[{\"attributes\":{\"children\":[{\"id\":\"1115\",\"type\":\"ToolbarBox\"},{\"id\":\"1113\",\"type\":\"GridBox\"}]},\"id\":\"1116\",\"type\":\"Column\"},{\"attributes\":{\"callback\":null},\"id\":\"1005\",\"type\":\"DataRange1d\"},{\"attributes\":{\"text\":\"\"},\"id\":\"1087\",\"type\":\"Title\"},{\"attributes\":{},\"id\":\"1064\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"1044\",\"type\":\"BasicTicker\"},{\"attributes\":{\"formatter\":{\"id\":\"1106\",\"type\":\"BasicTickFormatter\"},\"ticker\":{\"id\":\"1067\",\"type\":\"BasicTicker\"}},\"id\":\"1066\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"1090\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"1072\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"1092\",\"type\":\"Selection\"},{\"attributes\":{\"dimension\":1,\"ticker\":{\"id\":\"1044\",\"type\":\"BasicTicker\"}},\"id\":\"1047\",\"type\":\"Grid\"},{\"attributes\":{\"fill_color\":{\"value\":\"navy\"},\"line_color\":{\"value\":\"navy\"},\"size\":{\"units\":\"screen\",\"value\":10},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1027\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"1067\",\"type\":\"BasicTicker\"},{\"attributes\":{\"formatter\":{\"id\":\"1099\",\"type\":\"BasicTickFormatter\"},\"ticker\":{\"id\":\"1044\",\"type\":\"BasicTicker\"}},\"id\":\"1043\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"1088\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"1009\",\"type\":\"LinearScale\"},{\"attributes\":{\"ticker\":{\"id\":\"1067\",\"type\":\"BasicTicker\"}},\"id\":\"1070\",\"type\":\"Grid\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"1048\",\"type\":\"PanTool\"},{\"id\":\"1049\",\"type\":\"WheelZoomTool\"}]},\"id\":\"1050\",\"type\":\"Toolbar\"},{\"attributes\":{\"formatter\":{\"id\":\"1088\",\"type\":\"BasicTickFormatter\"},\"ticker\":{\"id\":\"1012\",\"type\":\"BasicTicker\"}},\"id\":\"1011\",\"type\":\"LinearAxis\"},{\"attributes\":{\"dimension\":1,\"ticker\":{\"id\":\"1072\",\"type\":\"BasicTicker\"}},\"id\":\"1075\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"1093\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"1048\",\"type\":\"PanTool\"},{\"attributes\":{\"formatter\":{\"id\":\"1108\",\"type\":\"BasicTickFormatter\"},\"ticker\":{\"id\":\"1072\",\"type\":\"BasicTicker\"}},\"id\":\"1071\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"1017\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"1012\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"1099\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"1021\",\"type\":\"PanTool\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"1076\",\"type\":\"PanTool\"},{\"id\":\"1077\",\"type\":\"WheelZoomTool\"}]},\"id\":\"1078\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"1022\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"1049\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"ticker\":{\"id\":\"1012\",\"type\":\"BasicTicker\"}},\"id\":\"1015\",\"type\":\"Grid\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"1021\",\"type\":\"PanTool\"},{\"id\":\"1022\",\"type\":\"WheelZoomTool\"}]},\"id\":\"1023\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"1076\",\"type\":\"PanTool\"},{\"attributes\":{\"tools\":[{\"id\":\"1021\",\"type\":\"PanTool\"},{\"id\":\"1022\",\"type\":\"WheelZoomTool\"},{\"id\":\"1048\",\"type\":\"PanTool\"},{\"id\":\"1049\",\"type\":\"WheelZoomTool\"},{\"id\":\"1076\",\"type\":\"PanTool\"},{\"id\":\"1077\",\"type\":\"WheelZoomTool\"}]},\"id\":\"1114\",\"type\":\"ProxyToolbar\"},{\"attributes\":{\"text\":\"\"},\"id\":\"1096\",\"type\":\"Title\"},{\"attributes\":{},\"id\":\"1039\",\"type\":\"BasicTicker\"},{\"attributes\":{\"children\":[[{\"id\":\"1002\",\"subtype\":\"Figure\",\"type\":\"Plot\"},0,0],[{\"id\":\"1031\",\"subtype\":\"Figure\",\"type\":\"Plot\"},0,1],[{\"id\":\"1058\",\"subtype\":\"Figure\",\"type\":\"Plot\"},0,2]]},\"id\":\"1113\",\"type\":\"GridBox\"},{\"attributes\":{\"formatter\":{\"id\":\"1090\",\"type\":\"BasicTickFormatter\"},\"ticker\":{\"id\":\"1017\",\"type\":\"BasicTicker\"}},\"id\":\"1016\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"1097\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"1077\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"dimension\":1,\"ticker\":{\"id\":\"1017\",\"type\":\"BasicTicker\"}},\"id\":\"1020\",\"type\":\"Grid\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":10},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1055\",\"type\":\"Triangle\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":10},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1028\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"1102\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"data_source\":{\"id\":\"1026\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"1027\",\"type\":\"Circle\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1028\",\"type\":\"Circle\"},\"selection_glyph\":null,\"view\":{\"id\":\"1030\",\"type\":\"CDSView\"}},\"id\":\"1029\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"fill_color\":{\"value\":\"firebrick\"},\"line_color\":{\"value\":\"firebrick\"},\"size\":{\"units\":\"screen\",\"value\":10},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1054\",\"type\":\"Triangle\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":10},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1083\",\"type\":\"Square\"},{\"attributes\":{\"callback\":null,\"data\":{\"x\":[0,1,2,3,4,5,6,7,8,9,10],\"y\":[5,4,3,2,1,0,1,2,3,4,5]},\"selected\":{\"id\":\"1110\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"1111\",\"type\":\"UnionRenderers\"}},\"id\":\"1081\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"1108\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"data_source\":{\"id\":\"1053\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"1054\",\"type\":\"Triangle\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1055\",\"type\":\"Triangle\"},\"selection_glyph\":null,\"view\":{\"id\":\"1057\",\"type\":\"CDSView\"}},\"id\":\"1056\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"source\":{\"id\":\"1026\",\"type\":\"ColumnDataSource\"}},\"id\":\"1030\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"1110\",\"type\":\"Selection\"},{\"attributes\":{\"callback\":null,\"data\":{\"x\":[0,1,2,3,4,5,6,7,8,9,10],\"y\":[0,1,2,3,4,5,6,7,8,9,10]},\"selected\":{\"id\":\"1092\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"1093\",\"type\":\"UnionRenderers\"}},\"id\":\"1026\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"callback\":null,\"data\":{\"x\":[0,1,2,3,4,5,6,7,8,9,10],\"y\":[10,9,8,7,6,5,4,3,2,1,0]},\"selected\":{\"id\":\"1101\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"1102\",\"type\":\"UnionRenderers\"}},\"id\":\"1053\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"fill_color\":{\"value\":\"olive\"},\"line_color\":{\"value\":\"olive\"},\"size\":{\"units\":\"screen\",\"value\":10},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1082\",\"type\":\"Square\"},{\"attributes\":{\"below\":[{\"id\":\"1011\",\"type\":\"LinearAxis\"}],\"center\":[{\"id\":\"1015\",\"type\":\"Grid\"},{\"id\":\"1020\",\"type\":\"Grid\"}],\"left\":[{\"id\":\"1016\",\"type\":\"LinearAxis\"}],\"plot_height\":250,\"plot_width\":250,\"renderers\":[{\"id\":\"1029\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"1087\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"1023\",\"type\":\"Toolbar\"},\"toolbar_location\":null,\"x_range\":{\"id\":\"1003\",\"type\":\"DataRange1d\"},\"x_scale\":{\"id\":\"1007\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"1005\",\"type\":\"DataRange1d\"},\"y_scale\":{\"id\":\"1009\",\"type\":\"LinearScale\"}},\"id\":\"1002\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"below\":[{\"id\":\"1038\",\"type\":\"LinearAxis\"}],\"center\":[{\"id\":\"1042\",\"type\":\"Grid\"},{\"id\":\"1047\",\"type\":\"Grid\"}],\"left\":[{\"id\":\"1043\",\"type\":\"LinearAxis\"}],\"plot_height\":250,\"plot_width\":250,\"renderers\":[{\"id\":\"1056\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"1096\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"1050\",\"type\":\"Toolbar\"},\"toolbar_location\":null,\"x_range\":{\"id\":\"1003\",\"type\":\"DataRange1d\"},\"x_scale\":{\"id\":\"1034\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"1005\",\"type\":\"DataRange1d\"},\"y_scale\":{\"id\":\"1036\",\"type\":\"LinearScale\"}},\"id\":\"1031\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"below\":[{\"id\":\"1066\",\"type\":\"LinearAxis\"}],\"center\":[{\"id\":\"1070\",\"type\":\"Grid\"},{\"id\":\"1075\",\"type\":\"Grid\"}],\"left\":[{\"id\":\"1071\",\"type\":\"LinearAxis\"}],\"plot_height\":250,\"plot_width\":250,\"renderers\":[{\"id\":\"1084\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"1105\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"1078\",\"type\":\"Toolbar\"},\"toolbar_location\":null,\"x_range\":{\"id\":\"1003\",\"type\":\"DataRange1d\"},\"x_scale\":{\"id\":\"1062\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"1060\",\"type\":\"DataRange1d\"},\"y_scale\":{\"id\":\"1064\",\"type\":\"LinearScale\"}},\"id\":\"1058\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"text\":\"\"},\"id\":\"1105\",\"type\":\"Title\"},{\"attributes\":{\"callback\":null},\"id\":\"1060\",\"type\":\"DataRange1d\"},{\"attributes\":{\"source\":{\"id\":\"1053\",\"type\":\"ColumnDataSource\"}},\"id\":\"1057\",\"type\":\"CDSView\"},{\"attributes\":{\"callback\":null},\"id\":\"1003\",\"type\":\"DataRange1d\"},{\"attributes\":{\"ticker\":{\"id\":\"1039\",\"type\":\"BasicTicker\"}},\"id\":\"1042\",\"type\":\"Grid\"},{\"attributes\":{\"data_source\":{\"id\":\"1081\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"1082\",\"type\":\"Square\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1083\",\"type\":\"Square\"},\"selection_glyph\":null,\"view\":{\"id\":\"1085\",\"type\":\"CDSView\"}},\"id\":\"1084\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"1106\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"formatter\":{\"id\":\"1097\",\"type\":\"BasicTickFormatter\"},\"ticker\":{\"id\":\"1039\",\"type\":\"BasicTicker\"}},\"id\":\"1038\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"1036\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"1062\",\"type\":\"LinearScale\"},{\"attributes\":{\"source\":{\"id\":\"1081\",\"type\":\"ColumnDataSource\"}},\"id\":\"1085\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"1101\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"1034\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"1111\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"toolbar\":{\"id\":\"1114\",\"type\":\"ProxyToolbar\"},\"toolbar_location\":\"above\"},\"id\":\"1115\",\"type\":\"ToolbarBox\"},{\"attributes\":{},\"id\":\"1007\",\"type\":\"LinearScale\"}],\"root_ids\":[\"1116\"]},\"title\":\"Bokeh Application\",\"version\":\"1.4.0\"}};\n",
       "  var render_items = [{\"docid\":\"8c1dccb5-ce36-4b77-9df2-63233dc50bba\",\"roots\":{\"1116\":\"2880d8c3-0486-4bf6-bc03-a2891652b4f3\"}}];\n",
       "  root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n",
       "\n",
       "  }\n",
       "  if (root.Bokeh !== undefined) {\n",
       "    embed_document(root);\n",
       "  } else {\n",
       "    var attempts = 0;\n",
       "    var timer = setInterval(function(root) {\n",
       "      if (root.Bokeh !== undefined) {\n",
       "        clearInterval(timer);\n",
       "        embed_document(root);\n",
       "      } else {\n",
       "        attempts++;\n",
       "        if (attempts > 100) {\n",
       "          clearInterval(timer);\n",
       "          console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n",
       "        }\n",
       "      }\n",
       "    }, 10, root)\n",
       "  }\n",
       "})(window);"
      ],
      "application/vnd.bokehjs_exec.v0+json": ""
     },
     "metadata": {
      "application/vnd.bokehjs_exec.v0+json": {
       "id": "1116"
      }
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "from bokeh.layouts import gridplot\n",
    "\n",
    "x = list(range(11))\n",
    "y0, y1, y2 = x, [10-i for i in x], [abs(i-5) for i in x]\n",
    "\n",
    "plot_options = dict(width=250, plot_height=250, tools='pan,wheel_zoom')\n",
    "\n",
    "# create a new plot\n",
    "s1 = figure(**plot_options)\n",
    "s1.circle(x, y0, size=10, color=\"navy\")\n",
    "\n",
    "# create a new plot and share both ranges\n",
    "s2 = figure(x_range=s1.x_range, y_range=s1.y_range, **plot_options)\n",
    "s2.triangle(x, y1, size=10, color=\"firebrick\")\n",
    "\n",
    "# create a new plot and share only one range\n",
    "s3 = figure(x_range=s1.x_range, **plot_options)\n",
    "s3.square(x, y2, size=10, color=\"olive\")\n",
    "\n",
    "p = gridplot([[s1, s2, s3]])\n",
    "\n",
    "# show the results\n",
    "show(p)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "# EXERCISE: create two plots in a gridplot, and link their ranges\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Linked brushing\n",
    "\n",
    "Linking selections is accomplished in a similar way, by sharing data sources between plots. Note that normally with ``bokeh.plotting`` and ``bokeh.charts`` creating a default data source for simple plots is handled automatically. However to share a data source, we must create them by hand and pass them explicitly. This is illustrated in the example below:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "  <div class=\"bk-root\" id=\"cab88f35-ac73-49ef-b207-8dbe847efd1d\" data-root-id=\"1373\"></div>\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "(function(root) {\n",
       "  function embed_document(root) {\n",
       "    \n",
       "  var docs_json = {\"8033aa40-c70e-420a-8122-d61eff30edc4\":{\"roots\":{\"references\":[{\"attributes\":{\"children\":[{\"id\":\"1372\",\"type\":\"ToolbarBox\"},{\"id\":\"1370\",\"type\":\"GridBox\"}]},\"id\":\"1373\",\"type\":\"Column\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"xs_units\":\"screen\",\"ys_units\":\"screen\"},\"id\":\"1357\",\"type\":\"PolyAnnotation\"},{\"attributes\":{\"callback\":null,\"overlay\":{\"id\":\"1367\",\"type\":\"BoxAnnotation\"}},\"id\":\"1336\",\"type\":\"BoxSelectTool\"},{\"attributes\":{\"callback\":null},\"id\":\"1287\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"1296\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"1322\",\"type\":\"LinearScale\"},{\"attributes\":{\"toolbar\":{\"id\":\"1371\",\"type\":\"ProxyToolbar\"},\"toolbar_location\":\"above\"},\"id\":\"1372\",\"type\":\"ToolbarBox\"},{\"attributes\":{\"ticker\":{\"id\":\"1296\",\"type\":\"BasicTicker\"}},\"id\":\"1299\",\"type\":\"Grid\"},{\"attributes\":{\"dimension\":1,\"ticker\":{\"id\":\"1332\",\"type\":\"BasicTicker\"}},\"id\":\"1335\",\"type\":\"Grid\"},{\"attributes\":{\"fill_color\":{\"value\":\"#1f77b4\"},\"line_color\":{\"value\":\"#1f77b4\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y1\"}},\"id\":\"1344\",\"type\":\"Circle\"},{\"attributes\":{\"children\":[[{\"id\":\"1286\",\"subtype\":\"Figure\",\"type\":\"Plot\"},0,0],[{\"id\":\"1317\",\"subtype\":\"Figure\",\"type\":\"Plot\"},0,1]]},\"id\":\"1370\",\"type\":\"GridBox\"},{\"attributes\":{\"dimension\":1,\"ticker\":{\"id\":\"1301\",\"type\":\"BasicTicker\"}},\"id\":\"1304\",\"type\":\"Grid\"},{\"attributes\":{\"text\":\"\"},\"id\":\"1349\",\"type\":\"Title\"},{\"attributes\":{\"fill_color\":{\"value\":\"#1f77b4\"},\"line_color\":{\"value\":\"#1f77b4\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y0\"}},\"id\":\"1313\",\"type\":\"Circle\"},{\"attributes\":{\"tools\":[{\"id\":\"1305\",\"type\":\"BoxSelectTool\"},{\"id\":\"1306\",\"type\":\"LassoSelectTool\"},{\"id\":\"1307\",\"type\":\"HelpTool\"},{\"id\":\"1336\",\"type\":\"BoxSelectTool\"},{\"id\":\"1337\",\"type\":\"LassoSelectTool\"},{\"id\":\"1338\",\"type\":\"HelpTool\"}]},\"id\":\"1371\",\"type\":\"ProxyToolbar\"},{\"attributes\":{\"callback\":null},\"id\":\"1320\",\"type\":\"DataRange1d\"},{\"attributes\":{\"formatter\":{\"id\":\"1361\",\"type\":\"BasicTickFormatter\"},\"ticker\":{\"id\":\"1327\",\"type\":\"BasicTicker\"}},\"id\":\"1326\",\"type\":\"LinearAxis\"},{\"attributes\":{\"formatter\":{\"id\":\"1352\",\"type\":\"BasicTickFormatter\"},\"ticker\":{\"id\":\"1301\",\"type\":\"BasicTicker\"}},\"id\":\"1300\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"1324\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"1363\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"ticker\":{\"id\":\"1327\",\"type\":\"BasicTicker\"}},\"id\":\"1330\",\"type\":\"Grid\"},{\"attributes\":{\"below\":[{\"id\":\"1326\",\"type\":\"LinearAxis\"}],\"center\":[{\"id\":\"1330\",\"type\":\"Grid\"},{\"id\":\"1335\",\"type\":\"Grid\"}],\"left\":[{\"id\":\"1331\",\"type\":\"LinearAxis\"}],\"plot_height\":300,\"plot_width\":300,\"renderers\":[{\"id\":\"1346\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"1360\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"1339\",\"type\":\"Toolbar\"},\"toolbar_location\":null,\"x_range\":{\"id\":\"1318\",\"type\":\"DataRange1d\"},\"x_scale\":{\"id\":\"1322\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"1320\",\"type\":\"DataRange1d\"},\"y_scale\":{\"id\":\"1324\",\"type\":\"LinearScale\"}},\"id\":\"1317\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"source\":{\"id\":\"1285\",\"type\":\"ColumnDataSource\"}},\"id\":\"1347\",\"type\":\"CDSView\"},{\"attributes\":{\"formatter\":{\"id\":\"1363\",\"type\":\"BasicTickFormatter\"},\"ticker\":{\"id\":\"1332\",\"type\":\"BasicTicker\"}},\"id\":\"1331\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"1338\",\"type\":\"HelpTool\"},{\"attributes\":{},\"id\":\"1352\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"1354\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"1307\",\"type\":\"HelpTool\"},{\"attributes\":{\"callback\":null},\"id\":\"1289\",\"type\":\"DataRange1d\"},{\"attributes\":{\"callback\":null,\"overlay\":{\"id\":\"1368\",\"type\":\"PolyAnnotation\"}},\"id\":\"1337\",\"type\":\"LassoSelectTool\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"1305\",\"type\":\"BoxSelectTool\"},{\"id\":\"1306\",\"type\":\"LassoSelectTool\"},{\"id\":\"1307\",\"type\":\"HelpTool\"}]},\"id\":\"1308\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"1350\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"below\":[{\"id\":\"1295\",\"type\":\"LinearAxis\"}],\"center\":[{\"id\":\"1299\",\"type\":\"Grid\"},{\"id\":\"1304\",\"type\":\"Grid\"}],\"left\":[{\"id\":\"1300\",\"type\":\"LinearAxis\"}],\"plot_height\":300,\"plot_width\":300,\"renderers\":[{\"id\":\"1315\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"1349\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"1308\",\"type\":\"Toolbar\"},\"toolbar_location\":null,\"x_range\":{\"id\":\"1287\",\"type\":\"DataRange1d\"},\"x_scale\":{\"id\":\"1291\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"1289\",\"type\":\"DataRange1d\"},\"y_scale\":{\"id\":\"1293\",\"type\":\"LinearScale\"}},\"id\":\"1286\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"callback\":null,\"overlay\":{\"id\":\"1356\",\"type\":\"BoxAnnotation\"}},\"id\":\"1305\",\"type\":\"BoxSelectTool\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y1\"}},\"id\":\"1345\",\"type\":\"Circle\"},{\"attributes\":{\"callback\":null,\"overlay\":{\"id\":\"1357\",\"type\":\"PolyAnnotation\"}},\"id\":\"1306\",\"type\":\"LassoSelectTool\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"1336\",\"type\":\"BoxSelectTool\"},{\"id\":\"1337\",\"type\":\"LassoSelectTool\"},{\"id\":\"1338\",\"type\":\"HelpTool\"}]},\"id\":\"1339\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"1293\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"1332\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"1355\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"1301\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"1327\",\"type\":\"BasicTicker\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"1356\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"1291\",\"type\":\"LinearScale\"},{\"attributes\":{\"text\":\"\"},\"id\":\"1360\",\"type\":\"Title\"},{\"attributes\":{},\"id\":\"1361\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"formatter\":{\"id\":\"1350\",\"type\":\"BasicTickFormatter\"},\"ticker\":{\"id\":\"1296\",\"type\":\"BasicTicker\"}},\"id\":\"1295\",\"type\":\"LinearAxis\"},{\"attributes\":{\"data_source\":{\"id\":\"1285\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"1313\",\"type\":\"Circle\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1314\",\"type\":\"Circle\"},\"selection_glyph\":null,\"view\":{\"id\":\"1316\",\"type\":\"CDSView\"}},\"id\":\"1315\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"1367\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"callback\":null,\"data\":{\"x\":[-20,-19,-18,-17,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20],\"y0\":[20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20],\"y1\":[400,361,324,289,256,225,196,169,144,121,100,81,64,49,36,25,16,9,4,1,0,1,4,9,16,25,36,49,64,81,100,121,144,169,196,225,256,289,324,361,400]},\"selected\":{\"id\":\"1354\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"1355\",\"type\":\"UnionRenderers\"}},\"id\":\"1285\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"source\":{\"id\":\"1285\",\"type\":\"ColumnDataSource\"}},\"id\":\"1316\",\"type\":\"CDSView\"},{\"attributes\":{\"data_source\":{\"id\":\"1285\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"1344\",\"type\":\"Circle\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1345\",\"type\":\"Circle\"},\"selection_glyph\":null,\"view\":{\"id\":\"1347\",\"type\":\"CDSView\"}},\"id\":\"1346\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y0\"}},\"id\":\"1314\",\"type\":\"Circle\"},{\"attributes\":{\"callback\":null},\"id\":\"1318\",\"type\":\"DataRange1d\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"xs_units\":\"screen\",\"ys_units\":\"screen\"},\"id\":\"1368\",\"type\":\"PolyAnnotation\"}],\"root_ids\":[\"1373\"]},\"title\":\"Bokeh Application\",\"version\":\"1.4.0\"}};\n",
       "  var render_items = [{\"docid\":\"8033aa40-c70e-420a-8122-d61eff30edc4\",\"roots\":{\"1373\":\"cab88f35-ac73-49ef-b207-8dbe847efd1d\"}}];\n",
       "  root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n",
       "\n",
       "  }\n",
       "  if (root.Bokeh !== undefined) {\n",
       "    embed_document(root);\n",
       "  } else {\n",
       "    var attempts = 0;\n",
       "    var timer = setInterval(function(root) {\n",
       "      if (root.Bokeh !== undefined) {\n",
       "        clearInterval(timer);\n",
       "        embed_document(root);\n",
       "      } else {\n",
       "        attempts++;\n",
       "        if (attempts > 100) {\n",
       "          clearInterval(timer);\n",
       "          console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n",
       "        }\n",
       "      }\n",
       "    }, 10, root)\n",
       "  }\n",
       "})(window);"
      ],
      "application/vnd.bokehjs_exec.v0+json": ""
     },
     "metadata": {
      "application/vnd.bokehjs_exec.v0+json": {
       "id": "1373"
      }
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "from bokeh.models import ColumnDataSource\n",
    "\n",
    "x = list(range(-20, 21))\n",
    "y0, y1 = [abs(xx) for xx in x], [xx**2 for xx in x]\n",
    "\n",
    "# create a column data source for the plots to share\n",
    "source = ColumnDataSource(data=dict(x=x, y0=y0, y1=y1))\n",
    "\n",
    "TOOLS = \"box_select,lasso_select,help\"\n",
    "\n",
    "# create a new plot and add a renderer\n",
    "left = figure(tools=TOOLS, width=300, height=300)\n",
    "left.circle('x', 'y0', source=source)\n",
    "\n",
    "# create another new plot and add a renderer\n",
    "right = figure(tools=TOOLS, width=300, height=300)\n",
    "right.circle('x', 'y1', source=source)\n",
    "\n",
    "p = gridplot([[left, right]])\n",
    "\n",
    "show(p)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "# EXERCISE: create two plots in a gridplot, and link their data sources\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Hover Tools\n",
    "\n",
    "Bokeh has a Hover Tool that allows additional information to be displayed in a popup whenever the user hovers over a specific glyph. Basic hover tool configuration amounts to providing a list of ``(name, format)`` tuples. The full details can be found in the User's Guide [here](http://bokeh.pydata.org/en/latest/docs/user_guide/tools.html#hovertool).\n",
    "\n",
    "The example below shows some basic usage of the Hover tool with a circle glyph, using hover information defined in utils.py:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "  <div class=\"bk-root\" id=\"02077ee8-2908-4bc4-b8f6-1da90ce05085\" data-root-id=\"1528\"></div>\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "(function(root) {\n",
       "  function embed_document(root) {\n",
       "    \n",
       "  var docs_json = {\"7a5f167f-6555-4e89-8eab-228e55b571b8\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"1539\",\"type\":\"LinearAxis\"}],\"center\":[{\"id\":\"1543\",\"type\":\"Grid\"},{\"id\":\"1548\",\"type\":\"Grid\"}],\"left\":[{\"id\":\"1544\",\"type\":\"LinearAxis\"}],\"plot_height\":300,\"plot_width\":300,\"renderers\":[{\"id\":\"1554\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"1529\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"1549\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"1531\",\"type\":\"DataRange1d\"},\"x_scale\":{\"id\":\"1535\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"1533\",\"type\":\"DataRange1d\"},\"y_scale\":{\"id\":\"1537\",\"type\":\"LinearScale\"}},\"id\":\"1528\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"source\":{\"id\":\"1526\",\"type\":\"ColumnDataSource\"}},\"id\":\"1555\",\"type\":\"CDSView\"},{\"attributes\":{\"callback\":null},\"id\":\"1531\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"1599\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"1535\",\"type\":\"LinearScale\"},{\"attributes\":{\"callback\":null},\"id\":\"1533\",\"type\":\"DataRange1d\"},{\"attributes\":{\"fill_color\":{\"value\":\"#1f77b4\"},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":20},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1552\",\"type\":\"Circle\"},{\"attributes\":{\"data_source\":{\"id\":\"1526\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"1552\",\"type\":\"Circle\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1553\",\"type\":\"Circle\"},\"selection_glyph\":null,\"view\":{\"id\":\"1555\",\"type\":\"CDSView\"}},\"id\":\"1554\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"1537\",\"type\":\"LinearScale\"},{\"attributes\":{\"formatter\":{\"id\":\"1599\",\"type\":\"BasicTickFormatter\"},\"ticker\":{\"id\":\"1540\",\"type\":\"BasicTicker\"}},\"id\":\"1539\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"1545\",\"type\":\"BasicTicker\"},{\"attributes\":{\"callback\":null,\"tooltips\":[[\"index\",\"$index\"],[\"(x,y)\",\"($x, $y)\"],[\"desc\",\"@desc\"]]},\"id\":\"1527\",\"type\":\"HoverTool\"},{\"attributes\":{},\"id\":\"1540\",\"type\":\"BasicTicker\"},{\"attributes\":{\"ticker\":{\"id\":\"1540\",\"type\":\"BasicTicker\"}},\"id\":\"1543\",\"type\":\"Grid\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"1527\",\"type\":\"HoverTool\"}]},\"id\":\"1549\",\"type\":\"Toolbar\"},{\"attributes\":{\"dimension\":1,\"ticker\":{\"id\":\"1545\",\"type\":\"BasicTicker\"}},\"id\":\"1548\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"1603\",\"type\":\"Selection\"},{\"attributes\":{\"formatter\":{\"id\":\"1601\",\"type\":\"BasicTickFormatter\"},\"ticker\":{\"id\":\"1545\",\"type\":\"BasicTicker\"}},\"id\":\"1544\",\"type\":\"LinearAxis\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":20},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1553\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"1604\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"text\":\"Mouse over the dots\"},\"id\":\"1529\",\"type\":\"Title\"},{\"attributes\":{},\"id\":\"1601\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"callback\":null,\"data\":{\"desc\":[\"A\",\"b\",\"C\",\"d\",\"E\"],\"x\":[1,2,3,4,5],\"y\":[2,5,8,2,7]},\"selected\":{\"id\":\"1603\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"1604\",\"type\":\"UnionRenderers\"}},\"id\":\"1526\",\"type\":\"ColumnDataSource\"}],\"root_ids\":[\"1528\"]},\"title\":\"Bokeh Application\",\"version\":\"1.4.0\"}};\n",
       "  var render_items = [{\"docid\":\"7a5f167f-6555-4e89-8eab-228e55b571b8\",\"roots\":{\"1528\":\"02077ee8-2908-4bc4-b8f6-1da90ce05085\"}}];\n",
       "  root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n",
       "\n",
       "  }\n",
       "  if (root.Bokeh !== undefined) {\n",
       "    embed_document(root);\n",
       "  } else {\n",
       "    var attempts = 0;\n",
       "    var timer = setInterval(function(root) {\n",
       "      if (root.Bokeh !== undefined) {\n",
       "        clearInterval(timer);\n",
       "        embed_document(root);\n",
       "      } else {\n",
       "        attempts++;\n",
       "        if (attempts > 100) {\n",
       "          clearInterval(timer);\n",
       "          console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n",
       "        }\n",
       "      }\n",
       "    }, 10, root)\n",
       "  }\n",
       "})(window);"
      ],
      "application/vnd.bokehjs_exec.v0+json": ""
     },
     "metadata": {
      "application/vnd.bokehjs_exec.v0+json": {
       "id": "1528"
      }
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "from bokeh.models import HoverTool\n",
    "\n",
    "source = ColumnDataSource(\n",
    "        data=dict(\n",
    "            x=[1, 2, 3, 4, 5],\n",
    "            y=[2, 5, 8, 2, 7],\n",
    "            desc=['A', 'b', 'C', 'd', 'E'],\n",
    "        )\n",
    "    )\n",
    "\n",
    "hover = HoverTool(\n",
    "        tooltips=[\n",
    "            (\"index\", \"$index\"),\n",
    "            (\"(x,y)\", \"($x, $y)\"),\n",
    "            (\"desc\", \"@desc\"),\n",
    "        ]\n",
    "    )\n",
    "\n",
    "p = figure(plot_width=300, plot_height=300, tools=[hover], title=\"Mouse over the dots\")\n",
    "\n",
    "p.circle('x', 'y', size=20, source=source)\n",
    "\n",
    "show(p)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Widgets"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Bokeh supports direct integration with a small basic widget set. Thse can be used in conjunction with a Bokeh Server, or with ``CustomJS`` models to add more interactive capability to your documents. You can see a complete list, with example code in the [Adding Widgets](http://bokeh.pydata.org/en/latest/docs/user_guide/interaction.html#adding-widgets) section of the User's Guide. \n",
    "\n",
    "\n",
    "\n",
    "*NOTE: In this Tutorial chapter, we will focus on using widgets with JavaScript callbacks. The Tutorial chapter on Bokeh server applications covers using Bokeh widgets with real Python callbacks*\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "To use the widgets, include them in a layout like you would a plot object:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "  <div class=\"bk-root\" id=\"6621d9a0-fbdc-4faf-8482-e51a3d703b3a\" data-root-id=\"1648\"></div>\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "(function(root) {\n",
       "  function embed_document(root) {\n",
       "    \n",
       "  var docs_json = {\"5e69538e-b862-4ec1-b797-dbbc6f9b786a\":{\"roots\":{\"references\":[{\"attributes\":{\"children\":[{\"id\":\"1647\",\"type\":\"Slider\"}]},\"id\":\"1648\",\"type\":\"WidgetBox\"},{\"attributes\":{\"callback\":null,\"end\":10,\"start\":0,\"step\":0.1,\"title\":\"foo\",\"value\":1},\"id\":\"1647\",\"type\":\"Slider\"}],\"root_ids\":[\"1648\"]},\"title\":\"Bokeh Application\",\"version\":\"1.4.0\"}};\n",
       "  var render_items = [{\"docid\":\"5e69538e-b862-4ec1-b797-dbbc6f9b786a\",\"roots\":{\"1648\":\"6621d9a0-fbdc-4faf-8482-e51a3d703b3a\"}}];\n",
       "  root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n",
       "\n",
       "  }\n",
       "  if (root.Bokeh !== undefined) {\n",
       "    embed_document(root);\n",
       "  } else {\n",
       "    var attempts = 0;\n",
       "    var timer = setInterval(function(root) {\n",
       "      if (root.Bokeh !== undefined) {\n",
       "        clearInterval(timer);\n",
       "        embed_document(root);\n",
       "      } else {\n",
       "        attempts++;\n",
       "        if (attempts > 100) {\n",
       "          clearInterval(timer);\n",
       "          console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n",
       "        }\n",
       "      }\n",
       "    }, 10, root)\n",
       "  }\n",
       "})(window);"
      ],
      "application/vnd.bokehjs_exec.v0+json": ""
     },
     "metadata": {
      "application/vnd.bokehjs_exec.v0+json": {
       "id": "1648"
      }
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "from bokeh.layouts import widgetbox\n",
    "from bokeh.models.widgets import Slider\n",
    "\n",
    "\n",
    "slider = Slider(start=0, end=10, value=1, step=.1, title=\"foo\")\n",
    "\n",
    "show(widgetbox(slider))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "# EXERCISE: create and show a Select widget \n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# CustomJS Callbacks\n",
    "\n",
    "In order for a widget to be useful, it needs to be able to perform some action. Using the Bokeh server, it is possible to have widgets trigger real Python code. That possibuility will be explored in the Bokeh server chapter of the turorial. Here, we look at how widgets can be configured with `CustomJS` callbacks that execute snippets of JavaScript code. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "  <div class=\"bk-root\" id=\"99019d4a-d4a1-498e-b507-f477d7dfdf76\" data-root-id=\"1700\"></div>\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "(function(root) {\n",
       "  function embed_document(root) {\n",
       "    \n",
       "  var docs_json = {\"05b85bd6-5b6b-499d-b0c6-fbba66e34548\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"1709\",\"type\":\"LinearAxis\"}],\"center\":[{\"id\":\"1713\",\"type\":\"Grid\"},{\"id\":\"1718\",\"type\":\"Grid\"}],\"left\":[{\"id\":\"1714\",\"type\":\"LinearAxis\"}],\"plot_height\":300,\"renderers\":[{\"id\":\"1724\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"1776\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"1719\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"1701\",\"type\":\"DataRange1d\"},\"x_scale\":{\"id\":\"1705\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"1703\",\"type\":\"DataRange1d\"},\"y_scale\":{\"id\":\"1707\",\"type\":\"LinearScale\"}},\"id\":\"1700\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"1699\",\"type\":\"TapTool\"}]},\"id\":\"1719\",\"type\":\"Toolbar\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":20},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1723\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"1779\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"1707\",\"type\":\"LinearScale\"},{\"attributes\":{\"data_source\":{\"id\":\"1721\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"1722\",\"type\":\"Circle\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1723\",\"type\":\"Circle\"},\"selection_glyph\":null,\"view\":{\"id\":\"1725\",\"type\":\"CDSView\"}},\"id\":\"1724\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"source\":{\"id\":\"1721\",\"type\":\"ColumnDataSource\"}},\"id\":\"1725\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"1705\",\"type\":\"LinearScale\"},{\"attributes\":{\"callback\":null},\"id\":\"1703\",\"type\":\"DataRange1d\"},{\"attributes\":{\"text\":\"\"},\"id\":\"1776\",\"type\":\"Title\"},{\"attributes\":{\"dimension\":1,\"ticker\":{\"id\":\"1715\",\"type\":\"BasicTicker\"}},\"id\":\"1718\",\"type\":\"Grid\"},{\"attributes\":{\"code\":\"alert('you tapped a circle!')\"},\"id\":\"1698\",\"type\":\"CustomJS\"},{\"attributes\":{\"ticker\":{\"id\":\"1710\",\"type\":\"BasicTicker\"}},\"id\":\"1713\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"1781\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"1710\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"1782\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"formatter\":{\"id\":\"1777\",\"type\":\"BasicTickFormatter\"},\"ticker\":{\"id\":\"1710\",\"type\":\"BasicTicker\"}},\"id\":\"1709\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"1777\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"fill_color\":{\"value\":\"#1f77b4\"},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":20},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1722\",\"type\":\"Circle\"},{\"attributes\":{\"callback\":{\"id\":\"1698\",\"type\":\"CustomJS\"}},\"id\":\"1699\",\"type\":\"TapTool\"},{\"attributes\":{\"formatter\":{\"id\":\"1779\",\"type\":\"BasicTickFormatter\"},\"ticker\":{\"id\":\"1715\",\"type\":\"BasicTicker\"}},\"id\":\"1714\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"1715\",\"type\":\"BasicTicker\"},{\"attributes\":{\"callback\":null},\"id\":\"1701\",\"type\":\"DataRange1d\"},{\"attributes\":{\"callback\":null,\"data\":{\"x\":[1,2,3,4,5],\"y\":[2,5,8,2,7]},\"selected\":{\"id\":\"1781\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"1782\",\"type\":\"UnionRenderers\"}},\"id\":\"1721\",\"type\":\"ColumnDataSource\"}],\"root_ids\":[\"1700\"]},\"title\":\"Bokeh Application\",\"version\":\"1.4.0\"}};\n",
       "  var render_items = [{\"docid\":\"05b85bd6-5b6b-499d-b0c6-fbba66e34548\",\"roots\":{\"1700\":\"99019d4a-d4a1-498e-b507-f477d7dfdf76\"}}];\n",
       "  root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n",
       "\n",
       "  }\n",
       "  if (root.Bokeh !== undefined) {\n",
       "    embed_document(root);\n",
       "  } else {\n",
       "    var attempts = 0;\n",
       "    var timer = setInterval(function(root) {\n",
       "      if (root.Bokeh !== undefined) {\n",
       "        clearInterval(timer);\n",
       "        embed_document(root);\n",
       "      } else {\n",
       "        attempts++;\n",
       "        if (attempts > 100) {\n",
       "          clearInterval(timer);\n",
       "          console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n",
       "        }\n",
       "      }\n",
       "    }, 10, root)\n",
       "  }\n",
       "})(window);"
      ],
      "application/vnd.bokehjs_exec.v0+json": ""
     },
     "metadata": {
      "application/vnd.bokehjs_exec.v0+json": {
       "id": "1700"
      }
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "from bokeh.models import TapTool, CustomJS, ColumnDataSource\n",
    "\n",
    "callback = CustomJS(code=\"alert('you tapped a circle!')\")\n",
    "tap = TapTool(callback=callback)\n",
    "\n",
    "p = figure(plot_width=600, plot_height=300, tools=[tap])\n",
    "\n",
    "p.circle(x=[1, 2, 3, 4, 5], y=[2, 5, 8, 2, 7], size=20)\n",
    "\n",
    "show(p)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## CustomJS for Property changes\n",
    "\n",
    "Bokeh objects that have values associated can have small JavaScript actions attached to them using the `js_on_change` method. These actions (also referred to as \"callbacks\") are executed whenever the widget's value is changed. In order to make it easier to refer to specific Bokeh models (e.g., a data source, or a glyhph) from JavaScript, the ``CustomJS`` obejct also accepts a dictionary of \"args\" that map names to Python Bokeh models. The corresponding JavaScript models are made available automaticaly to the ``CustomJS`` code:\n",
    "\n",
    "```python\n",
    "CustomJS(args=dict(source=source, slider=slider), code=\"\"\"\n",
    "    // easily refer to BokehJS source and slider objects in this JS code\n",
    "    var data = source.data;\n",
    "    var f = slider.value;\n",
    "\"\"\")\n",
    "```"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Slider widget example\n",
    "\n",
    "The example below shows an action attached to a slider that updates a data source whenever the slider is moved.  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "  <div class=\"bk-root\" id=\"e1dc17a3-9893-4747-8935-77d72f7d54e3\" data-root-id=\"1871\"></div>\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "(function(root) {\n",
       "  function embed_document(root) {\n",
       "    \n",
       "  var docs_json = {\"d5887ca8-f552-4806-98c9-86585e49039d\":{\"roots\":{\"references\":[{\"attributes\":{\"children\":[{\"id\":\"1869\",\"type\":\"Slider\"},{\"id\":\"1832\",\"subtype\":\"Figure\",\"type\":\"Plot\"}]},\"id\":\"1871\",\"type\":\"Column\"},{\"attributes\":{\"formatter\":{\"id\":\"1931\",\"type\":\"BasicTickFormatter\"},\"ticker\":{\"id\":\"1842\",\"type\":\"BasicTicker\"}},\"id\":\"1841\",\"type\":\"LinearAxis\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#1f77b4\",\"line_width\":3,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1866\",\"type\":\"Line\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"1851\",\"type\":\"PanTool\"},{\"id\":\"1852\",\"type\":\"WheelZoomTool\"},{\"id\":\"1853\",\"type\":\"BoxZoomTool\"},{\"id\":\"1854\",\"type\":\"SaveTool\"},{\"id\":\"1855\",\"type\":\"ResetTool\"},{\"id\":\"1856\",\"type\":\"HelpTool\"}]},\"id\":\"1857\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"1847\",\"type\":\"BasicTicker\"},{\"attributes\":{\"data_source\":{\"id\":\"1831\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"1865\",\"type\":\"Line\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1866\",\"type\":\"Line\"},\"selection_glyph\":null,\"view\":{\"id\":\"1868\",\"type\":\"CDSView\"}},\"id\":\"1867\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"1851\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"1852\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"ticker\":{\"id\":\"1842\",\"type\":\"BasicTicker\"}},\"id\":\"1845\",\"type\":\"Grid\"},{\"attributes\":{\"callback\":null},\"id\":\"1833\",\"type\":\"DataRange1d\"},{\"attributes\":{\"callback\":null,\"end\":6,\"js_property_callbacks\":{\"change:value\":[{\"id\":\"1870\",\"type\":\"CustomJS\"}]},\"start\":0.1,\"step\":0.1,\"title\":\"power\",\"value\":1},\"id\":\"1869\",\"type\":\"Slider\"},{\"attributes\":{\"overlay\":{\"id\":\"1937\",\"type\":\"BoxAnnotation\"}},\"id\":\"1853\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"below\":[{\"id\":\"1841\",\"type\":\"LinearAxis\"}],\"center\":[{\"id\":\"1845\",\"type\":\"Grid\"},{\"id\":\"1850\",\"type\":\"Grid\"}],\"left\":[{\"id\":\"1846\",\"type\":\"LinearAxis\"}],\"plot_height\":400,\"plot_width\":400,\"renderers\":[{\"id\":\"1867\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"1930\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"1857\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"1833\",\"type\":\"DataRange1d\"},\"x_scale\":{\"id\":\"1837\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"1835\",\"type\":\"DataRange1d\"},\"y_scale\":{\"id\":\"1839\",\"type\":\"LinearScale\"}},\"id\":\"1832\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"1842\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"1936\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"1854\",\"type\":\"SaveTool\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"1937\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"1855\",\"type\":\"ResetTool\"},{\"attributes\":{},\"id\":\"1856\",\"type\":\"HelpTool\"},{\"attributes\":{},\"id\":\"1933\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"args\":{\"slider\":{\"id\":\"1869\",\"type\":\"Slider\"},\"source\":{\"id\":\"1831\",\"type\":\"ColumnDataSource\"}},\"code\":\"\\n    var data = source.data;\\n    var f = slider.value;\\n    x = data['x']\\n    y = data['y']\\n    for (i = 0; i < x.length; i++) {\\n        y[i] = Math.pow(x[i], f)\\n    }\\n    \\n    // necessary becasue we mutated source.data in-place\\n    source.change.emit();\\n\"},\"id\":\"1870\",\"type\":\"CustomJS\"},{\"attributes\":{},\"id\":\"1837\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"1931\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"dimension\":1,\"ticker\":{\"id\":\"1847\",\"type\":\"BasicTicker\"}},\"id\":\"1850\",\"type\":\"Grid\"},{\"attributes\":{\"callback\":null,\"data\":{\"x\":[0.0,0.005,0.01,0.015,0.02,0.025,0.03,0.035,0.04,0.045,0.05,0.055,0.06,0.065,0.07,0.075,0.08,0.085,0.09,0.095,0.1,0.105,0.11,0.115,0.12,0.125,0.13,0.135,0.14,0.145,0.15,0.155,0.16,0.165,0.17,0.17500000000000002,0.18,0.185,0.19,0.195,0.2,0.20500000000000002,0.21,0.215,0.22,0.225,0.23,0.23500000000000001,0.24,0.245,0.25,0.255,0.26,0.265,0.27,0.275,0.28,0.28500000000000003,0.29,0.295,0.3,0.305,0.31,0.315,0.32,0.325,0.33,0.335,0.34,0.34500000000000003,0.35000000000000003,0.355,0.36,0.365,0.37,0.375,0.38,0.385,0.39,0.395,0.4,0.405,0.41000000000000003,0.41500000000000004,0.42,0.425,0.43,0.435,0.44,0.445,0.45,0.455,0.46,0.465,0.47000000000000003,0.47500000000000003,0.48,0.485,0.49,0.495,0.5,0.505,0.51,0.515,0.52,0.525,0.53,0.535,0.54,0.545,0.55,0.555,0.56,0.5650000000000001,0.5700000000000001,0.5750000000000001,0.58,0.585,0.59,0.595,0.6,0.605,0.61,0.615,0.62,0.625,0.63,0.635,0.64,0.645,0.65,0.655,0.66,0.665,0.67,0.675,0.68,0.685,0.6900000000000001,0.6950000000000001,0.7000000000000001,0.705,0.71,0.715,0.72,0.725,0.73,0.735,0.74,0.745,0.75,0.755,0.76,0.765,0.77,0.775,0.78,0.785,0.79,0.795,0.8,0.805,0.81,0.8150000000000001,0.8200000000000001,0.8250000000000001,0.8300000000000001,0.835,0.84,0.845,0.85,0.855,0.86,0.865,0.87,0.875,0.88,0.885,0.89,0.895,0.9,0.905,0.91,0.915,0.92,0.925,0.93,0.935,0.9400000000000001,0.9450000000000001,0.9500000000000001,0.9550000000000001,0.96,0.965,0.97,0.975,0.98,0.985,0.99,0.995,1.0],\"y\":[0.0,0.005,0.01,0.015,0.02,0.025,0.03,0.035,0.04,0.045,0.05,0.055,0.06,0.065,0.07,0.075,0.08,0.085,0.09,0.095,0.1,0.105,0.11,0.115,0.12,0.125,0.13,0.135,0.14,0.145,0.15,0.155,0.16,0.165,0.17,0.17500000000000002,0.18,0.185,0.19,0.195,0.2,0.20500000000000002,0.21,0.215,0.22,0.225,0.23,0.23500000000000001,0.24,0.245,0.25,0.255,0.26,0.265,0.27,0.275,0.28,0.28500000000000003,0.29,0.295,0.3,0.305,0.31,0.315,0.32,0.325,0.33,0.335,0.34,0.34500000000000003,0.35000000000000003,0.355,0.36,0.365,0.37,0.375,0.38,0.385,0.39,0.395,0.4,0.405,0.41000000000000003,0.41500000000000004,0.42,0.425,0.43,0.435,0.44,0.445,0.45,0.455,0.46,0.465,0.47000000000000003,0.47500000000000003,0.48,0.485,0.49,0.495,0.5,0.505,0.51,0.515,0.52,0.525,0.53,0.535,0.54,0.545,0.55,0.555,0.56,0.5650000000000001,0.5700000000000001,0.5750000000000001,0.58,0.585,0.59,0.595,0.6,0.605,0.61,0.615,0.62,0.625,0.63,0.635,0.64,0.645,0.65,0.655,0.66,0.665,0.67,0.675,0.68,0.685,0.6900000000000001,0.6950000000000001,0.7000000000000001,0.705,0.71,0.715,0.72,0.725,0.73,0.735,0.74,0.745,0.75,0.755,0.76,0.765,0.77,0.775,0.78,0.785,0.79,0.795,0.8,0.805,0.81,0.8150000000000001,0.8200000000000001,0.8250000000000001,0.8300000000000001,0.835,0.84,0.845,0.85,0.855,0.86,0.865,0.87,0.875,0.88,0.885,0.89,0.895,0.9,0.905,0.91,0.915,0.92,0.925,0.93,0.935,0.9400000000000001,0.9450000000000001,0.9500000000000001,0.9550000000000001,0.96,0.965,0.97,0.975,0.98,0.985,0.99,0.995,1.0]},\"selected\":{\"id\":\"1935\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"1936\",\"type\":\"UnionRenderers\"}},\"id\":\"1831\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"callback\":null},\"id\":\"1835\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"1935\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"1839\",\"type\":\"LinearScale\"},{\"attributes\":{\"source\":{\"id\":\"1831\",\"type\":\"ColumnDataSource\"}},\"id\":\"1868\",\"type\":\"CDSView\"},{\"attributes\":{\"line_alpha\":0.6,\"line_color\":\"#1f77b4\",\"line_width\":3,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1865\",\"type\":\"Line\"},{\"attributes\":{\"formatter\":{\"id\":\"1933\",\"type\":\"BasicTickFormatter\"},\"ticker\":{\"id\":\"1847\",\"type\":\"BasicTicker\"}},\"id\":\"1846\",\"type\":\"LinearAxis\"},{\"attributes\":{\"text\":\"\"},\"id\":\"1930\",\"type\":\"Title\"}],\"root_ids\":[\"1871\"]},\"title\":\"Bokeh Application\",\"version\":\"1.4.0\"}};\n",
       "  var render_items = [{\"docid\":\"d5887ca8-f552-4806-98c9-86585e49039d\",\"roots\":{\"1871\":\"e1dc17a3-9893-4747-8935-77d72f7d54e3\"}}];\n",
       "  root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n",
       "\n",
       "  }\n",
       "  if (root.Bokeh !== undefined) {\n",
       "    embed_document(root);\n",
       "  } else {\n",
       "    var attempts = 0;\n",
       "    var timer = setInterval(function(root) {\n",
       "      if (root.Bokeh !== undefined) {\n",
       "        clearInterval(timer);\n",
       "        embed_document(root);\n",
       "      } else {\n",
       "        attempts++;\n",
       "        if (attempts > 100) {\n",
       "          clearInterval(timer);\n",
       "          console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n",
       "        }\n",
       "      }\n",
       "    }, 10, root)\n",
       "  }\n",
       "})(window);"
      ],
      "application/vnd.bokehjs_exec.v0+json": ""
     },
     "metadata": {
      "application/vnd.bokehjs_exec.v0+json": {
       "id": "1871"
      }
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "from bokeh.layouts import column\n",
    "from bokeh.models import CustomJS, ColumnDataSource, Slider\n",
    "\n",
    "x = [x*0.005 for x in range(0, 201)]\n",
    "\n",
    "source = ColumnDataSource(data=dict(x=x, y=x))\n",
    "\n",
    "plot = figure(plot_width=400, plot_height=400)\n",
    "plot.line('x', 'y', source=source, line_width=3, line_alpha=0.6)\n",
    "\n",
    "slider = Slider(start=0.1, end=6, value=1, step=.1, title=\"power\")\n",
    "\n",
    "update_curve = CustomJS(args=dict(source=source, slider=slider), code=\"\"\"\n",
    "    var data = source.data;\n",
    "    var f = slider.value;\n",
    "    x = data['x']\n",
    "    y = data['y']\n",
    "    for (i = 0; i < x.length; i++) {\n",
    "        y[i] = Math.pow(x[i], f)\n",
    "    }\n",
    "    \n",
    "    // necessary becasue we mutated source.data in-place\n",
    "    source.change.emit();\n",
    "\"\"\")\n",
    "slider.js_on_change('value', update_curve)\n",
    "\n",
    "\n",
    "show(column(slider, plot))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Exercise: Create a plot that updates based on a Select widget\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Data selection example\n",
    "\n",
    "It's also possible to make JavaScript actions that execute whenever a user selection (e.g., box, point, lasso) changes. This is done by attaching the same kind of CustomJS object to whatever data source the selection is made on.\n",
    "\n",
    "The example below is a bit more sophisticated, and demonstrates updating one glyph's data source in response to another glyph's selection: "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "  <div class=\"bk-root\" id=\"cef2002a-226c-4341-9a5f-31fcd18b7b7d\" data-root-id=\"1993\"></div>\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "(function(root) {\n",
       "  function embed_document(root) {\n",
       "    \n",
       "  var docs_json = {\"eff633fd-2f89-477a-b5e9-345b6a89e141\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"2004\",\"type\":\"LinearAxis\"}],\"center\":[{\"id\":\"2008\",\"type\":\"Grid\"},{\"id\":\"2013\",\"type\":\"Grid\"}],\"left\":[{\"id\":\"2009\",\"type\":\"LinearAxis\"}],\"plot_height\":400,\"plot_width\":400,\"renderers\":[{\"id\":\"2021\",\"type\":\"GlyphRenderer\"},{\"id\":\"2027\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"1994\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"2015\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"1996\",\"type\":\"DataRange1d\"},\"x_scale\":{\"id\":\"2000\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"1998\",\"type\":\"DataRange1d\"},\"y_scale\":{\"id\":\"2002\",\"type\":\"LinearScale\"}},\"id\":\"1993\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"2014\",\"type\":\"LassoSelectTool\"}]},\"id\":\"2015\",\"type\":\"Toolbar\"},{\"attributes\":{\"callback\":{\"id\":\"2029\",\"type\":\"CustomJS\"},\"data\":{\"color\":[\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\"],\"x\":[0.6810214437794341,0.2242391398981295,0.4104746646118488,0.6137898763310369,0.7822705409560106,0.06830720811879043,0.09090552746194192,0.008044929524467337,0.8635883471308777,0.04541961436959785,0.740222792753483,0.9912439204415345,0.1815527761254907,0.9840398631462094,0.7142274836521032,0.6894247060303176,0.2203677420071074,0.34828141414672786,0.5846884590138619,0.5572482338773096,0.02726494446189698,0.3844028114456317,0.09674683628046699,0.3276321117165647,0.3016498264301416,0.7605211311698377,0.16450888188117008,0.36111861568230863,0.34485625193398173,0.7877538799364294,0.3133311742622602,0.8215796676604977,0.9992906303135216,0.3072697641066,0.8425520965665874,0.20360288114557523,0.8861568496522324,0.6313448340562016,0.608199103993027,0.9167412592185039,0.6721368218088183,0.002268883885048978,0.03598740678918633,0.7295606689633118,0.8100179242197104,0.6687046649868277,0.04749769874529752,0.6247418018477388,0.7282755378572529,0.2558058408842758,0.03765319589714766,0.7339512237689849,0.6818931583194351,0.46205458844751013,0.6831364172429055,0.7414046026753113,0.5382817873432275,0.5311438070613148,0.17834203405796467,0.7029456704385934,0.29829725111528793,0.864028386652165,0.20251353744795464,0.3925593588471198,0.3254511979436203,0.35653203192372085,0.22160469321402743,0.45685001755228716,0.4731479383855871,0.1035679069537152,0.9145917136715777,0.8498242144605077,0.5400102534113121,0.752469928378473,0.6537510853240281,0.2638697547783857,0.29256027004402063,0.8582748266995057,0.3583927996195354,0.790631929036354,0.957091967629261,0.08669415442144324,0.9020394741030096,0.8819830740211445,0.6028200148401363,0.8327992494392558,0.10287519790126154,0.73094650567888,0.9373574750891854,0.08884059477644579,0.8314476534848548,0.5529398581087839,0.9817067723474394,0.7517248844161589,0.16194583458901313,0.8644607448303067,0.6347706014896773,0.3537076080609294,0.5618219933683093,0.8957978054178454,0.23080455189935156,0.7579323933494723,0.199695161849769,0.37759013555491416,0.4649875483400545,0.08735148289467698,0.158780540677948,0.17789711969233335,0.7925569695001801,0.0757844569608912,0.239643927159926,0.8576358672906442,0.9422021236695906,0.04702997622345639,0.6275805364282586,0.5825744502051594,0.8763805926897164,0.6956962073609355,0.3455368735686305,0.5925645363355064,0.7570345680563288,0.757670713428529,0.6417165815615787,0.3824330680178074,0.6400201206802714,0.07643782406373678,0.4601052987908053,0.2968405900628547,0.017328845802638493,0.9541237431467786,0.8365386316814347,0.6774075182153116,0.5431842310897145,0.826391439246749,0.40488899970791503,0.05146976633764844,0.5182996552161995,0.9294888944592724,0.08397400145881728,0.8416906628872761,0.7805105283010626,0.839986503363206,0.25475741866005996,0.5639125698453727,0.6048659784141412,0.7545928900998026,0.80071910294736,0.121607531780354,0.7592343451449517,0.49917619215737685,0.33632515619171477,0.6318690897173191,0.23513885873711426,0.8916978038131598,0.2819934054362726,0.15922414895988402,0.38017308972380126,0.8958424961849366,0.22465525777350104,0.5865099538187333,0.21795314387605003,0.8149608019171372,0.6363899010808158,0.4435693494959496,0.29442732132883254,0.5616165557577747,0.8075352986120099,0.8944859732124998,0.6219515812735367,0.1407266493263306,0.6869360678657659,0.9864661581517082,0.8918598723492551,0.9981228137227739,0.4317346154960737,0.11676817467422873,0.26436973371785544,0.43853701018833136,0.3985107725968333,0.27741840846076105,0.692664971518455,0.24113574666375048,0.7761312501963057,0.8356345057117323,0.655214903830425,0.8207191232394566,0.12766561182443248,0.135026506925227,0.6764868361000386,0.5077729992749542,0.07795904504620976,0.542750993561443,0.581877998735808,0.8374936247676198,0.9469988084588795,0.891105981899042,0.4571079435594553,0.4577921741508214,0.23780297592558397,0.825810633801801,0.3695375257137222,0.8257414105260632,0.2569111791268416,0.05764157764712219,0.6818314711322835,0.4025905790781036,0.9041877199602908,0.2974192019799493,0.6212830106414313,0.24547390225988752,0.25323624377429677,0.1220282166955673,0.4980437762341532,0.7978203412432987,0.5620149395876629,0.04918718635530761,0.9411332293792316,0.351325227688164,0.8685376691724054,0.26866829434801054,0.17435977569280647,0.2661059802418072,0.47800249177915755,0.9130491837069808,0.3579137712740619,0.9921077547429613,0.7216458529762219,0.474158889883352,0.25834215899610946,0.47858974256118025,0.7325373232059621,0.8064576407968943,0.764999173287259,0.8718398696879265,0.8078959216495548,0.7660910539850841,0.29549639221504986,0.8146684785887763,0.6351372458404791,0.1919919998835623,0.6303844082991629,0.5711055652799525,0.24768489820031148,0.210412586010586,0.16527957452890962,0.31063774493920626,0.33778349592244516,0.7287203289960885,0.7784440698644032,0.6036649090155073,0.9560194408406865,0.9920808183157744,0.6268809536400903,0.4425617784955246,0.4860233012810622,0.7229917131266436,0.8172295399084919,0.0633734994139874,0.811843910951465,0.21036834611481348,0.12354195150876324,0.37472383590284986,0.8254682687813991,0.5405300932371471,0.7193601537980753,0.8980677796417734,0.42212673935889067,0.247167721235671,0.7717068767025378,0.10873161316566649,0.005329075728950361,0.8491981720627002,0.37452665903512283,0.35907063051291055,0.4343502808116836,0.8781182636594388,0.9082916138280915,0.08703888584346686,0.8221038138167934,0.9190156927083118,0.0762512241195209,0.7799175559277773,0.0081101850107409,0.6326798324149137,0.49832628312841365,0.6371674181764335,0.7337844431465835,0.11269599037211897,0.5806500008621885,0.11315561665056162,0.04553067137076261,0.8858375569749074,0.16700027294870945,0.9410297180331124,0.5252851318631967,0.9668249138789144,0.0818566049809436,0.16858288318342363,0.009186766422134118,0.6620687557702394,0.3654504053372062,0.8803894545811177,0.7734229139098175,0.07223936831914379,0.6426480375938467,0.22598330111978537,0.8578187286388193,0.5750374440807601,0.016921123678866,0.8680093348778912,0.29601086558291223,0.6583448731341599,0.6754483382223399,0.5961629148928717,0.47795690804677426,0.41185210367657776,0.30247463282696974,0.016939429402036854,0.027212300949393975,0.20099287205762328,0.48946671182807655,0.7536868040202871,0.12149748079985667,0.9616086503322758,0.15965903778003088,0.02902636917592516,0.6556815179870503,0.5348424119176494,0.8668852887355959,0.7936854420286533,0.5608373175221781,0.7448295218714406,0.25142721174560434,0.2892744169342,0.7447543925965662,0.23756724877253876,0.5839951115017185,0.201404417401027,0.37545846644296443,0.917452856044716,0.5175310445136527,0.8110947491549892,0.4247877926434289,0.20637486140309036,0.9078465453748858,0.2437056568816376,0.9903176426691505,0.031782028139344054,0.80736666237129,0.09681738158128639,0.10652155042974953,0.6942220963815796,0.14418663788543407,0.5004266128816072,0.7966381759708578,0.36624763048984665,0.14872783918027044,0.3453780784973033,0.09887461284270227,0.6742040594758545,0.6415735976055306,0.3378616047949142,0.7723850685368719,0.2541997041356997,0.05173892433578997,0.1337656285658957,0.30935574916671216,0.6238087991660953,0.8261099034210789,0.513737122437607,0.7324721341059836,0.5643572583474719,0.265183606972933,0.1608338801164363,0.7526810714314781,0.5553385541931894,0.1644828785175424,0.7008338037645762,0.22934722508331917,0.4368626293511382,0.9759915332591924,0.8670544385954764,0.14328143730642395,0.23632650788553677,0.4115955478843063,0.6181338633678058,0.9674213696153937,0.8165136843819195,0.6361837032614398,0.82579264038433,0.2366650552439341,0.04471925842312685,0.6795864140352443,0.08754050297319715,0.7328613233841635,0.0650415668613985,0.25243805605225245,0.6708035684294936,0.14952526492239016,0.6764186769685773,0.35995963062562963,0.7580960582932847,0.5256144201962905,0.4106091321899311,0.25940188565007094,0.27842443397084693,0.7481017752353829,0.6122733228800841,0.17164727050571815,0.5660169640214073,0.46491000792018244,0.015362043131250447,0.10795243782067587,0.22423718345142973,0.7548103756945105,0.3362270206674651,0.16904586459595716,0.7674626183129383,0.16112082660970373,0.4397315373956968,0.6159642045983924,0.22342093332104906,0.2940848218312122,0.13810452005389207,0.553894836466407,0.24936340719337247,0.9435115000221431,0.22443836093187997,0.20237550645004043,0.38173588239314193,0.571861831207455,0.9130385852778068,0.6853694866214946,0.798666850778699,0.8489869937621084,0.2326290075794637,0.22791691321265484,0.19296440445920282,0.48712404844814494,0.029022707543000403,0.6728782014709271,0.4381694867638001,0.25808852277860395,0.12082180932877562,0.6766626914750896,0.4512463147281497,0.36471377656684245,0.6735439214374256,0.3769352667056265,0.06684361741929279,0.3131791279837489,0.4860027035420007,0.15340006183313737,0.7133543493046011,0.11848714759462675,0.023959457180620758,0.6622718370871462,0.8205856813560047,0.3402457123972469,0.09166028561967798,0.5305335409219045,0.9427337270747328,0.457508026351776,0.12396972597698264,0.3376900758873025,0.07380596528682715,0.11815878458503537,0.31142737645403884,0.2811628852301197,0.8770539187649959,0.9997880614755329,0.5591142409201137,0.14020197066024198,0.0875379200971449,0.9807276794452899,0.7988015932476068,0.45027887890598095,0.46543768125818674,0.426097848331482,0.52426961051545,0.7594915091785555,0.049142232266714325,0.7028371660902836,0.6127797187925832,0.7275155222860439,0.22193933887018358,0.3702963701581049,0.09158155161795123,0.36206912826204307,0.2403636439643182,0.7126669760359893,0.5188779520098067,0.8215296135589559,0.9614937311194849,0.8683344545643037,0.6653607303945588,0.7086152452534803,0.41461178860008807,0.8122877179613931,0.650450263501745],\"y\":[0.9503015817002586,0.797223461171117,0.7278427275299639,0.16672443945371918,0.9074948671430212,0.5123432832515726,0.7527528235429883,0.16246843324554205,0.7978074389769876,0.6029607493229182,0.11602616669331933,0.43867120051582453,0.8115159360387416,0.3483004442661971,0.6944946182904169,0.641301532719492,0.2271866905565868,0.24759380640168616,0.6428689661157084,0.8029719686887163,0.8223917421501238,0.9387525691066988,0.21755327174921657,0.73293726493191,0.8362893038940317,0.7406876866642343,0.20264251622793694,0.7669317707359531,0.8975938010954072,0.9533528514835797,0.1631993617291564,0.8312779610913149,0.5097790231613986,0.311786129514813,0.21229126771760554,0.35452961639495795,0.03998448126696397,0.2619070316542442,0.06046735503142475,0.7546979633511144,0.9369952778697658,0.36467637768439753,0.0001546335472281113,0.20798362139848858,0.4444727780608404,0.2009195724448244,0.489931038378005,0.9460649698488715,0.8176528998758604,0.07201972433610737,0.8036315539065212,0.4269833658014708,0.6648630771003031,0.3344311763219753,0.8754763434395978,0.27522177141877124,0.6020349938572195,0.8618528818537924,0.6757080431703617,0.762207553332658,0.02018757358067713,0.12960886900626967,0.28365754624718875,0.1737208676867562,0.11034435015069544,0.6040976340262795,0.5249713029673371,0.4813041201223053,0.09954219612728721,0.6042032764801877,0.21298844271526451,0.23747471365617856,0.3890082341859613,0.7880420320280654,0.6688283753256831,0.19945192573131354,0.24090306952583518,0.3605176336185193,0.2050862256424565,0.7643776536420672,0.3887240634573981,0.5955557360971783,0.41240588011571866,0.8196168966310526,0.3144524759647601,0.4675520558202818,0.9778513641699949,0.9378108642355152,0.3893687644505337,0.04599043053398044,0.27432498057025567,0.8636893507712551,0.1764186505153953,0.9868775428235259,0.08619513451811689,0.6158388530155801,0.3914642619403196,0.4855389572908275,0.16092276318232035,0.17809986014818147,0.5249086246883019,0.714110211638642,0.12974252799464658,0.08063443809788684,0.5757179459929537,0.2585481179788983,0.7564109034410526,0.5245674689126067,0.5719144607107052,0.04816325760443574,0.01721069530848507,0.2016442944262007,0.46860116865624224,0.3697189765879726,0.5364386124728608,0.3411639546469377,0.6328789183895223,0.45708262968226776,0.3315013535018776,0.5893388091777605,0.9725615537987462,0.89727179554431,0.17471912736233763,0.2278827899349829,0.3496756832583191,0.5824357371865276,0.6642930207005016,0.7946602407684588,0.07902700505270166,0.2525468046609527,0.25940922717718284,0.8897174448863269,0.8588199186362313,0.7854241442458628,0.770968869949285,0.5898157177390284,0.5691169597948922,0.6462791219653415,0.1641213079153434,0.3006788244793488,0.4637442225067606,0.5720329561178978,0.943751105115369,0.9804931436351167,0.16841241461496803,0.5064015669550941,0.1808052588225676,0.21320473723452282,0.7822191324487981,0.8719260471364367,0.10568296237439767,0.32022025127585596,0.795409471256876,0.1673483771460259,0.20078316618296543,0.3275764039703908,0.6871001673248093,0.893680822712667,0.5857030238397063,0.8274960762160389,0.5701952171670062,0.5724869345327211,0.3409529604852467,0.9565300604011981,0.06842741439270328,0.13674060412728684,0.19478327917265026,0.5858216983658974,0.02517967224657347,0.7033859655976874,0.8498278673460035,0.4977988842814167,0.08420538219022655,0.6530146030839412,0.8271564892258823,0.7200900012235729,0.8785571860477035,0.03971139807958235,0.6432411325679817,0.30933877847832847,0.4608821334599337,0.9641789637760502,0.5739975818144659,0.31009691617907154,0.04452331312861979,0.03890181069460796,0.4358546630192881,0.3052346460418137,0.482951400981654,0.08080121558050035,0.8886153613044206,0.8603044617457473,0.5298578532454027,0.7034711941417171,0.2834548387581659,0.21887336115900924,0.13542352031557148,0.9592590747981068,0.8097866412833995,0.7888674264164043,0.18965641597837735,0.054679641408167945,0.9904858592220318,0.9007291624977747,0.582148201411638,0.6198288619950149,0.7716169989528787,0.5075000348152271,0.4044541436498704,0.970626825768075,0.54906063626381,0.016455244265366598,0.19211214947790267,0.2587711337215831,0.4977527969213237,0.2995350499957402,0.830379699622504,0.9270977907417145,0.9731542041763276,0.9272630459440964,0.49790146149562386,0.1100560143214303,0.6340689145847744,0.2886873546427785,0.2847839316220151,0.39094850844635953,0.2946201075796674,0.10452752037571011,0.383988181600434,0.3812597965413621,0.7909844395088973,0.8770841786934919,0.4527697438613111,0.8409982121675381,0.23718034845699054,0.1443778168714579,0.05458907346879138,0.8808302692047674,0.49980121364580454,0.5596131203668877,0.8616005981597159,0.14755785462451254,0.023191992964119112,0.198065173597059,0.16715075567133497,0.010449909922058631,0.16046360185407382,0.33005377566224003,0.783837709673064,0.996358921275561,0.35070954308127755,0.4687729099807326,0.7378920639690001,0.43592269993540544,0.8465173395380804,0.645206335288315,0.7662114882880361,0.5321070301357755,0.054178064462914066,0.17268942540296517,0.8032485170631836,0.8047960298334255,0.4713772770830288,0.17899740998045388,0.751475863846093,0.20272424729344163,0.6966252361528366,0.8178935264937263,0.8528969243142591,0.47008572587876307,0.5305356827251998,0.0689695498460915,0.37720474075808097,0.17989871519496248,0.11647020760834403,0.26044626257271175,0.39139828241744345,0.5773008189666677,0.9528741649948983,0.8496846624069612,0.9295428938084187,0.6160505109783823,0.5567807371902957,0.1640960648709685,0.42401240681470875,0.13314930821287874,0.46467692194548194,0.590939745162593,0.7191342976577745,0.5049029478507582,0.9958321207930695,0.5177024105780565,0.7352992619120786,0.2615684512216838,0.6361623275159873,0.7857598985655214,0.13690580787112816,0.33814493231503995,0.8289175545215328,0.2281216169381769,0.17437788492195716,0.8285665669618479,0.9045235903263407,0.9709721642775817,0.2239593137933914,0.008448031892495544,0.3041063193802439,0.7590760229877942,0.7013684880991564,0.5937843085385611,0.45567765524716675,0.6596603472021917,0.02768176294298097,0.9444108264609302,0.1157432651358209,0.828699741572689,0.8183109803985916,0.9133641126382432,0.742775512675586,0.1620445345597391,0.9872154679233855,0.5094906808859757,0.7776760110841765,0.6672244715466955,0.8860675313487677,0.45565472829462006,0.16546754445565837,0.047603345829642874,0.39722515971097005,0.5341273480516333,0.5143050445392622,0.4750853321594143,0.8995897967376927,0.8796192172724114,0.9000220309860095,0.6676524095579766,0.7249250920538853,0.11014173675049155,0.6395674401333085,0.7351085700626669,0.09685339589119135,0.09153225393066955,0.1872368229345035,0.48155729345450504,0.24781296221956806,0.7795333839930356,0.6023484010843171,0.24502424510180953,0.26730046359808324,0.1263851471579709,0.08735279021492048,0.8329169175147085,0.033982964617849776,0.8581718940720127,0.5642440732263022,0.7738740238659334,0.6088127222603325,0.5752538315076557,0.1071946507320568,0.7996471694213403,0.13842319858011443,0.6223929888251846,0.19049165323206851,0.8341223457380996,0.920584242289844,0.7309566531494481,0.4205954926494746,0.8655807187064211,0.9378796906974938,0.7954689535324738,0.8366287675299671,0.7947561279524006,0.610702226383983,0.42959895151463756,0.09806238587669935,0.5214021805876063,0.07218232954292492,0.6071796979136312,0.07094375618788373,0.6306094621220408,0.8744647323683101,0.5574033722276128,0.310488933438559,0.6321153581227101,0.08566387630517525,0.974343817940021,0.6827394627904058,0.9744063846598623,0.8505931759474066,0.1845810704219244,0.04372047308954874,0.600066950988158,0.4780134410245266,0.9442731988322136,0.7674773246888081,0.40680021203529315,0.4421712965057297,0.797267390720056,0.15532931075000378,0.635699301297297,0.30011865098964996,0.8169447188187337,0.8964214966799147,0.9512597309280754,0.9103171855290554,0.5051124586935564,0.48685108856773496,0.7225895242916487,0.39117432445897193,0.790852540724575,0.6196445633866587,0.058268512023678,0.3199198973314019,0.11700913363228838,0.133886314479711,0.9643958010234512,0.4878217562876508,0.06635253731042146,0.3496276352323725,0.4926611528207625,0.367131307732829,0.08252929572142087,0.06514749106805129,0.33155905223789395,0.1259791904406643,0.7335420614460811,0.7526766668666218,0.8979421011205984,0.18845228339256348,0.8151549352400491,0.82546736404422,0.4536459415960451,0.4914295678215387,0.6363506915309105,0.8953677268475012,0.2848604843928799,0.8292491992881384,0.6694091299785394,0.9395002586659654,0.834645207123076,0.9884294010293958,0.6877450990790784,0.17019302936279035,0.3336832952276113,0.282494753178416,0.18467746742562718,0.23563008007098907,0.6660585283709877,0.30678817646359136,0.649465831081512,0.7532475509853651,0.0634346331878527,0.9378691548340047,0.2964768508365251,0.7529511389489887,0.644139889303206,0.01741166446746678,0.8623918835091083,0.5587514961574856,0.7736801049036198,0.7969844737915041,0.016006848540933705,0.6043176835024688,0.2778390652575571,0.3392728878465918,0.8696927648031215,0.4965477029239558,0.2630463040155385,0.10750633741358495,0.4530256788300244,0.8492880992699242,0.17490141726889563,0.7387684246528139,0.08059715484293473,0.0004972515727816873,0.5481317220103891,0.34911704497400364,0.08044828587541508,0.5213503538308109,0.12947606209692242,0.08715446397698745,0.4547813197767294,0.45164482463736944,0.9490809501817629,0.7667725128526309,0.2942048428717339,0.44207883946016835,0.6134843306535239,0.8518192302952659,0.7334849175070911,0.09998915252996432,0.5289460934748714,0.36324600497140347,0.9218455234072652,0.287509325024879,0.32440293381779517,0.8802929733642489,0.14632669584172697,0.2144631373685565,0.2644006850572467]},\"selected\":{\"id\":\"2101\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"2102\",\"type\":\"UnionRenderers\"}},\"id\":\"1992\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"source\":{\"id\":\"2023\",\"type\":\"ColumnDataSource\"}},\"id\":\"2028\",\"type\":\"CDSView\"},{\"attributes\":{\"callback\":null,\"data\":{\"xm\":[0,1],\"ym\":[0.5,0.5]},\"selected\":{\"id\":\"2103\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"2104\",\"type\":\"UnionRenderers\"}},\"id\":\"2023\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"callback\":null,\"overlay\":{\"id\":\"2105\",\"type\":\"PolyAnnotation\"}},\"id\":\"2014\",\"type\":\"LassoSelectTool\"},{\"attributes\":{\"callback\":null},\"id\":\"1996\",\"type\":\"DataRange1d\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":8},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2019\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"2103\",\"type\":\"Selection\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.4},\"fill_color\":{\"field\":\"color\"},\"line_alpha\":{\"value\":0.4},\"line_color\":{\"field\":\"color\"},\"size\":{\"units\":\"screen\",\"value\":8},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2018\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"2104\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"text\":\"Select Here\"},\"id\":\"1994\",\"type\":\"Title\"},{\"attributes\":{},\"id\":\"2102\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"data_source\":{\"id\":\"1992\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"2018\",\"type\":\"Circle\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2019\",\"type\":\"Circle\"},\"selection_glyph\":{\"id\":\"2020\",\"type\":\"Circle\"},\"view\":{\"id\":\"2022\",\"type\":\"CDSView\"}},\"id\":\"2021\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"xs_units\":\"screen\",\"ys_units\":\"screen\"},\"id\":\"2105\",\"type\":\"PolyAnnotation\"},{\"attributes\":{},\"id\":\"2097\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"2000\",\"type\":\"LinearScale\"},{\"attributes\":{\"line_alpha\":0.6,\"line_color\":\"orange\",\"line_width\":5,\"x\":{\"field\":\"xm\"},\"y\":{\"field\":\"ym\"}},\"id\":\"2025\",\"type\":\"Line\"},{\"attributes\":{\"callback\":null},\"id\":\"1998\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"2099\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"args\":{\"s1\":{\"id\":\"1992\",\"type\":\"ColumnDataSource\"},\"s2\":{\"id\":\"2023\",\"type\":\"ColumnDataSource\"}},\"code\":\"\\n    var inds = s1.selected.indices;\\n    if (inds.length == 0)\\n        return;\\n\\n    var ym = 0\\n    for (var i = 0; i < inds.length; i++) {\\n        ym += s1.data.y[inds[i]]\\n    }\\n    \\n    ym /= inds.length\\n    s2.data.ym = [ym, ym]\\n\\n    // necessary becasue we mutated source.data in-place\\n    s2.change.emit();  \\n\"},\"id\":\"2029\",\"type\":\"CustomJS\"},{\"attributes\":{\"source\":{\"id\":\"1992\",\"type\":\"ColumnDataSource\"}},\"id\":\"2022\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"2002\",\"type\":\"LinearScale\"},{\"attributes\":{\"formatter\":{\"id\":\"2097\",\"type\":\"BasicTickFormatter\"},\"ticker\":{\"id\":\"2005\",\"type\":\"BasicTicker\"}},\"id\":\"2004\",\"type\":\"LinearAxis\"},{\"attributes\":{\"data_source\":{\"id\":\"2023\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"2025\",\"type\":\"Line\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2026\",\"type\":\"Line\"},\"selection_glyph\":null,\"view\":{\"id\":\"2028\",\"type\":\"CDSView\"}},\"id\":\"2027\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"2010\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"2005\",\"type\":\"BasicTicker\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#1f77b4\",\"line_width\":5,\"x\":{\"field\":\"xm\"},\"y\":{\"field\":\"ym\"}},\"id\":\"2026\",\"type\":\"Line\"},{\"attributes\":{\"ticker\":{\"id\":\"2005\",\"type\":\"BasicTicker\"}},\"id\":\"2008\",\"type\":\"Grid\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.4},\"fill_color\":{\"value\":\"firebrick\"},\"line_alpha\":{\"value\":0.4},\"line_color\":{\"value\":\"firebrick\"},\"size\":{\"units\":\"screen\",\"value\":8},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2020\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"2101\",\"type\":\"Selection\"},{\"attributes\":{\"dimension\":1,\"ticker\":{\"id\":\"2010\",\"type\":\"BasicTicker\"}},\"id\":\"2013\",\"type\":\"Grid\"},{\"attributes\":{\"formatter\":{\"id\":\"2099\",\"type\":\"BasicTickFormatter\"},\"ticker\":{\"id\":\"2010\",\"type\":\"BasicTicker\"}},\"id\":\"2009\",\"type\":\"LinearAxis\"}],\"root_ids\":[\"1993\"]},\"title\":\"Bokeh Application\",\"version\":\"1.4.0\"}};\n",
       "  var render_items = [{\"docid\":\"eff633fd-2f89-477a-b5e9-345b6a89e141\",\"roots\":{\"1993\":\"cef2002a-226c-4341-9a5f-31fcd18b7b7d\"}}];\n",
       "  root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n",
       "\n",
       "  }\n",
       "  if (root.Bokeh !== undefined) {\n",
       "    embed_document(root);\n",
       "  } else {\n",
       "    var attempts = 0;\n",
       "    var timer = setInterval(function(root) {\n",
       "      if (root.Bokeh !== undefined) {\n",
       "        clearInterval(timer);\n",
       "        embed_document(root);\n",
       "      } else {\n",
       "        attempts++;\n",
       "        if (attempts > 100) {\n",
       "          clearInterval(timer);\n",
       "          console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n",
       "        }\n",
       "      }\n",
       "    }, 10, root)\n",
       "  }\n",
       "})(window);"
      ],
      "application/vnd.bokehjs_exec.v0+json": ""
     },
     "metadata": {
      "application/vnd.bokehjs_exec.v0+json": {
       "id": "1993"
      }
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "from random import random\n",
    "\n",
    "x = [random() for x in range(500)]\n",
    "y = [random() for y in range(500)]\n",
    "color = [\"navy\"] * len(x)\n",
    "\n",
    "s1 = ColumnDataSource(data=dict(x=x, y=y, color=color))\n",
    "p = figure(plot_width=400, plot_height=400, tools=\"lasso_select\", title=\"Select Here\")\n",
    "p.circle('x', 'y', color='color', size=8, alpha=0.4, source=s1, \n",
    "         selection_color=\"firebrick\", selection_alpha=0.4)\n",
    "\n",
    "s2 = ColumnDataSource(data=dict(xm=[0,1],ym=[0.5, 0.5]))\n",
    "p.line(x='xm', y='ym', color=\"orange\", line_width=5, alpha=0.6, source=s2)\n",
    "\n",
    "s1.callback = CustomJS(args=dict(s1=s1, s2=s2), code=\"\"\"\n",
    "    var inds = s1.selected.indices;\n",
    "    if (inds.length == 0)\n",
    "        return;\n",
    "\n",
    "    var ym = 0\n",
    "    for (var i = 0; i < inds.length; i++) {\n",
    "        ym += s1.data.y[inds[i]]\n",
    "    }\n",
    "    \n",
    "    ym /= inds.length\n",
    "    s2.data.ym = [ym, ym]\n",
    "\n",
    "    // necessary becasue we mutated source.data in-place\n",
    "    s2.change.emit();  \n",
    "\"\"\")\n",
    "\n",
    "show(p)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Exercise: Experiment with selection callbacks\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## CustomJS for UI Events\n",
    "\n",
    "Bokeh also has a general events system\n",
    "\n",
    "All of the available UI events, and their properties, are listed in the Reference Guide section for [bokeh.events](https://bokeh.pydata.org/en/latest/docs/reference/events.html)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "  <div class=\"bk-root\" id=\"9c81937b-5e71-4309-b72d-f8b31cbb9842\" data-root-id=\"2368\"></div>\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "(function(root) {\n",
       "  function embed_document(root) {\n",
       "    \n",
       "  var docs_json = {\"4c1548a3-40e3-48c2-8877-8ff60d871603\":{\"roots\":{\"references\":[{\"attributes\":{\"children\":[{\"id\":\"2366\",\"type\":\"Button\"},{\"id\":\"2367\",\"type\":\"Row\"}]},\"id\":\"2368\",\"type\":\"Column\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.6},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_color\":{\"value\":null},\"radius\":{\"units\":\"data\",\"value\":1},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2361\",\"type\":\"Circle\"},{\"attributes\":{\"callback\":null,\"data\":{\"x\":{\"__ndarray__\":\"U6Me8s3XSUBXL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VAJZFm5hMyRUC4Wanpt68yQAN0Dz0wOUNAGLqEX5g6F0DlZksHrlVTQLcgQg7GYT9AseLOt5CPCkDH4myG6tVHQLFn3L82mVNAQ3MfN5BeNkAplrXXukBRQDLdVPwaAiVAJqX0AQ7pTEAv9OFO/79QQN8BN6e2okFAlu9KtXV3TUARZrvs0alHQDfhPR1XF1ZAJkwvL4qFSUBzmU/QUM5YQGoDIhIyP0BAk4+2wLmXUUDY29Lgcr4zQGFBY48TcUVAI1GI6gfyVEBlFRkrnghRQMvYutAvzFNA0KdTIZGRU0BMxPx6NEU5QGtr8CrLRVZAzCsF4QKRR0DwPYa+P5YUQIW1ReTk8TVAc+HLDlzkPUBZHke6Be5FQCEAKf+0J0NAhZgs+T9FSUCfFyjdcNtWQJf/PH6xSDVAOZEQ78W7MUCdhageNQtVQD26jVUQEFhAjtnXEwQHO0BQ6LTBSyQ7QIBZswnECVhAmpUV9ybGQED5FgcU4t5NQIy0AyX1by1AVXj2E6/JPEAgfflMVYU1QFcyoWxmIjZAZw0kJgEqTUDphu8mszU/QEZ7tqPexkJAfxTSa2P4QECWNl+ZQyJYQLMxEg3Y8FVADe1pQRfhVkAgquPQmQoZQMieO7OOqSVAhV2FXm7BQ0D0WnQ1s+0QQAKF/KVEEAhA53M2630XWED7ZBPtEj5YQJjTL9WDylJAQcETDNLdSUBy9GVob0xUQInN2veF1FJAHsN9U4FuVkBAFe5y+cISQAm/jR26e1BAZqufin6JJ0AdHzUdNy5EQJ443aWU+FRAxnS3EkhvWECuyIt1/iRSQMQSMJWcjlNA4sePlYVHOUCDnvlmFzJYQPtdNzZmmkZAy7QWngkeSkALeQ8PLgJHQA==\",\"dtype\":\"float64\",\"shape\":[2000]}},\"selected\":{\"id\":\"2462\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"2463\",\"type\":\"UnionRenderers\"}},\"id\":\"2360\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"2463\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"callback\":null,\"overlay\":{\"id\":\"2464\",\"type\":\"BoxAnnotation\"}},\"id\":\"2357\",\"type\":\"BoxSelectTool\"},{\"attributes\":{\"data_source\":{\"id\":\"2360\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"2361\",\"type\":\"Circle\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2362\",\"type\":\"Circle\"},\"selection_glyph\":null,\"view\":{\"id\":\"2364\",\"type\":\"CDSView\"}},\"id\":\"2363\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"2462\",\"type\":\"Selection\"},{\"attributes\":{\"callback\":null,\"icon\":null,\"js_event_callbacks\":{\"button_click\":[{\"id\":\"2369\",\"type\":\"CustomJS\"}]},\"width\":300},\"id\":\"2366\",\"type\":\"Button\"},{\"attributes\":{\"source\":{\"id\":\"2360\",\"type\":\"ColumnDataSource\"}},\"id\":\"2364\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"2343\",\"type\":\"LinearScale\"},{\"attributes\":{\"children\":[{\"id\":\"2338\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"id\":\"2365\",\"type\":\"Div\"}]},\"id\":\"2367\",\"type\":\"Row\"},{\"attributes\":{\"width\":400},\"id\":\"2365\",\"type\":\"Div\"},{\"attributes\":{\"args\":{\"div\":{\"id\":\"2365\",\"type\":\"Div\"}},\"code\":\"\\ndiv.text = \\\"Button!\\\";\\n\"},\"id\":\"2369\",\"type\":\"CustomJS\"},{\"attributes\":{},\"id\":\"2345\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"2460\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"formatter\":{\"id\":\"2458\",\"type\":\"BasicTickFormatter\"},\"ticker\":{\"id\":\"2348\",\"type\":\"BasicTicker\"}},\"id\":\"2347\",\"type\":\"LinearAxis\"},{\"attributes\":{\"callback\":null},\"id\":\"2339\",\"type\":\"DataRange1d\"},{\"attributes\":{\"below\":[{\"id\":\"2347\",\"type\":\"LinearAxis\"}],\"center\":[{\"id\":\"2351\",\"type\":\"Grid\"},{\"id\":\"2356\",\"type\":\"Grid\"}],\"js_event_callbacks\":{\"selectiongeometry\":[{\"id\":\"2370\",\"type\":\"CustomJS\"}]},\"left\":[{\"id\":\"2352\",\"type\":\"LinearAxis\"}],\"renderers\":[{\"id\":\"2363\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"2457\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"2358\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"2339\",\"type\":\"DataRange1d\"},\"x_scale\":{\"id\":\"2343\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"2341\",\"type\":\"DataRange1d\"},\"y_scale\":{\"id\":\"2345\",\"type\":\"LinearScale\"}},\"id\":\"2338\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"args\":{\"div\":{\"id\":\"2365\",\"type\":\"Div\"}},\"code\":\"\\ndiv.text = \\\"Selection! <p> <p>\\\" + JSON.stringify(cb_obj.geometry, undefined, 2);\\n\"},\"id\":\"2370\",\"type\":\"CustomJS\"},{\"attributes\":{},\"id\":\"2353\",\"type\":\"BasicTicker\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"radius\":{\"units\":\"data\",\"value\":1},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2362\",\"type\":\"Circle\"},{\"attributes\":{\"callback\":null},\"id\":\"2341\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"2348\",\"type\":\"BasicTicker\"},{\"attributes\":{\"ticker\":{\"id\":\"2348\",\"type\":\"BasicTicker\"}},\"id\":\"2351\",\"type\":\"Grid\"},{\"attributes\":{\"text\":\"\"},\"id\":\"2457\",\"type\":\"Title\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"2357\",\"type\":\"BoxSelectTool\"}]},\"id\":\"2358\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"2458\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"dimension\":1,\"ticker\":{\"id\":\"2353\",\"type\":\"BasicTicker\"}},\"id\":\"2356\",\"type\":\"Grid\"},{\"attributes\":{\"formatter\":{\"id\":\"2460\",\"type\":\"BasicTickFormatter\"},\"ticker\":{\"id\":\"2353\",\"type\":\"BasicTicker\"}},\"id\":\"2352\",\"type\":\"LinearAxis\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"2464\",\"type\":\"BoxAnnotation\"}],\"root_ids\":[\"2368\"]},\"title\":\"Bokeh Application\",\"version\":\"1.4.0\"}};\n",
       "  var render_items = [{\"docid\":\"4c1548a3-40e3-48c2-8877-8ff60d871603\",\"roots\":{\"2368\":\"9c81937b-5e71-4309-b72d-f8b31cbb9842\"}}];\n",
       "  root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n",
       "\n",
       "  }\n",
       "  if (root.Bokeh !== undefined) {\n",
       "    embed_document(root);\n",
       "  } else {\n",
       "    var attempts = 0;\n",
       "    var timer = setInterval(function(root) {\n",
       "      if (root.Bokeh !== undefined) {\n",
       "        clearInterval(timer);\n",
       "        embed_document(root);\n",
       "      } else {\n",
       "        attempts++;\n",
       "        if (attempts > 100) {\n",
       "          clearInterval(timer);\n",
       "          console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n",
       "        }\n",
       "      }\n",
       "    }, 10, root)\n",
       "  }\n",
       "})(window);"
      ],
      "application/vnd.bokehjs_exec.v0+json": ""
     },
     "metadata": {
      "application/vnd.bokehjs_exec.v0+json": {
       "id": "2368"
      }
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "from bokeh.plotting import figure\n",
    "from bokeh import events\n",
    "from bokeh.models import CustomJS, Div, Button\n",
    "from bokeh.layouts import column, row\n",
    "\n",
    "import numpy as np\n",
    "x = np.random.random(size=2000) * 100\n",
    "y = np.random.random(size=2000) * 100\n",
    "\n",
    "p = figure(tools=\"box_select\")\n",
    "p.scatter(x, y, radius=1, fill_alpha=0.6, line_color=None)\n",
    "\n",
    "div = Div(width=400)\n",
    "button = Button(label=\"Button\", width=300)\n",
    "layout = column(button, row(p, div))\n",
    "\n",
    "# Events with no attributes\n",
    "button.js_on_event(events.ButtonClick,  CustomJS(args=dict(div=div), code=\"\"\"\n",
    "div.text = \"Button!\";\n",
    "\"\"\")) \n",
    "\n",
    "p.js_on_event(events.SelectionGeometry, CustomJS(args=dict(div=div), code=\"\"\"\n",
    "div.text = \"Selection! <p> <p>\" + JSON.stringify(cb_obj.geometry, undefined, 2);\n",
    "\"\"\"))\n",
    "\n",
    "show(layout)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Exercise: Create a plot that responds to different events from bokeh.events\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Additional Information\n",
    "\n",
    "There are many kinds of interactions and events that can be connected to `CustomJS` callbacks. \n",
    "\n",
    "\n",
    "* Widgets - Button, Toggle, Dropdown, TextInput, AutocompleteInput, Select, Multiselect, Slider, (DateRangeSlider), DatePicker,\n",
    "* Tools - TapTool, BoxSelectTool, HoverTool,\n",
    "* Selection - ColumnDataSource, AjaxDataSource, BlazeDataSource, ServerDataSource\n",
    "* Ranges - Range1d, DataRange1d, FactorRange\n",
    "\n",
    "\n",
    "For more complete examples the User Guide section on [JavaScript Interactions](http://bokeh.pydata.org/en/latest/docs/user_guide/interaction.html)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "anaconda-cloud": {},
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
